summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/.cvsignore22
-rw-r--r--gui/Makefile.am248
-rw-r--r--gui/faces/.cvsignore2
-rw-r--r--gui/faces/Makefile.am32
-rw-r--r--gui/faces/astronaut.jpgbin3034 -> 0 bytes
-rw-r--r--gui/faces/baseball.pngbin12985 -> 0 bytes
-rw-r--r--gui/faces/butterfly.pngbin17171 -> 0 bytes
-rw-r--r--gui/faces/cat-eye.jpgbin5495 -> 0 bytes
-rw-r--r--gui/faces/chess.jpgbin3346 -> 0 bytes
-rw-r--r--gui/faces/coffee.jpgbin3467 -> 0 bytes
-rw-r--r--gui/faces/dice.jpgbin2807 -> 0 bytes
-rw-r--r--gui/faces/energy-arc.jpgbin2041 -> 0 bytes
-rw-r--r--gui/faces/fish.jpgbin3225 -> 0 bytes
-rw-r--r--gui/faces/flake.jpgbin4216 -> 0 bytes
-rw-r--r--gui/faces/flower.jpgbin3572 -> 0 bytes
-rw-r--r--gui/faces/grapes.jpgbin4045 -> 0 bytes
-rw-r--r--gui/faces/guitar.jpgbin2281 -> 0 bytes
-rw-r--r--gui/faces/launch.jpgbin3121 -> 0 bytes
-rw-r--r--gui/faces/leaf.jpgbin2627 -> 0 bytes
-rw-r--r--gui/faces/lightning.jpgbin2621 -> 0 bytes
-rw-r--r--gui/faces/penguin.jpgbin2192 -> 0 bytes
-rw-r--r--gui/faces/puppy.jpgbin3461 -> 0 bytes
-rw-r--r--gui/faces/sky.jpgbin2964 -> 0 bytes
-rw-r--r--gui/faces/soccerball.pngbin9267 -> 0 bytes
-rw-r--r--gui/faces/sunflower.jpgbin4105 -> 0 bytes
-rw-r--r--gui/faces/sunset.jpgbin2752 -> 0 bytes
-rw-r--r--gui/faces/tennis-ball.pngbin13432 -> 0 bytes
-rw-r--r--gui/faces/yellow-rose.jpgbin2727 -> 0 bytes
-rw-r--r--gui/gdmXnestchooser.c678
-rw-r--r--gui/gdmchooser.c2111
-rw-r--r--gui/gdmchooser.glade318
-rw-r--r--gui/gdmcomm.c711
-rw-r--r--gui/gdmcomm.h48
-rw-r--r--gui/gdmcommon.c845
-rw-r--r--gui/gdmcommon.h71
-rw-r--r--gui/gdmconfig.c676
-rw-r--r--gui/gdmconfig.h46
-rw-r--r--gui/gdmdynamic.c366
-rw-r--r--gui/gdmflexiserver-xnest.desktop.in.in14
-rw-r--r--gui/gdmflexiserver.c987
-rw-r--r--gui/gdmflexiserver.desktop.in13
-rw-r--r--gui/gdmlanguages.c649
-rw-r--r--gui/gdmlanguages.h45
-rw-r--r--gui/gdmlogin.c3796
-rw-r--r--gui/gdmphotosetup.c362
-rw-r--r--gui/gdmphotosetup.desktop.in15
-rw-r--r--gui/gdmphotosetup.glade165
-rw-r--r--gui/gdmsession.c492
-rw-r--r--gui/gdmsession.h63
-rw-r--r--gui/gdmsetup.c8544
-rw-r--r--gui/gdmsetup.desktop.in.in14
-rw-r--r--gui/gdmsetup.glade9923
-rw-r--r--gui/gdmuser.c379
-rw-r--r--gui/gdmuser.h44
-rw-r--r--gui/gdmwm.c1721
-rw-r--r--gui/gdmwm.h101
-rw-r--r--gui/greeter/.cvsignore6
-rw-r--r--gui/greeter/Makefile.am97
-rwxr-xr-xgui/greeter/gdmthemetester.in109
-rw-r--r--gui/greeter/greeter.c1610
-rw-r--r--gui/greeter/greeter.dtd78
-rw-r--r--gui/greeter/greeter.h32
-rw-r--r--gui/greeter/greeter_action_language.c391
-rw-r--r--gui/greeter/greeter_action_language.h39
-rw-r--r--gui/greeter/greeter_canvas_item.c769
-rw-r--r--gui/greeter/greeter_canvas_item.h33
-rw-r--r--gui/greeter/greeter_canvas_text.c213
-rw-r--r--gui/greeter/greeter_canvas_text.h33
-rw-r--r--gui/greeter/greeter_configuration.h72
-rw-r--r--gui/greeter/greeter_dialogs.c25
-rw-r--r--gui/greeter/greeter_dialogs.h26
-rw-r--r--gui/greeter/greeter_events.c256
-rw-r--r--gui/greeter/greeter_events.h35
-rw-r--r--gui/greeter/greeter_geometry.c623
-rw-r--r--gui/greeter/greeter_geometry.h27
-rw-r--r--gui/greeter/greeter_item.c235
-rw-r--r--gui/greeter/greeter_item.h223
-rw-r--r--gui/greeter/greeter_item_capslock.c133
-rw-r--r--gui/greeter/greeter_item_capslock.h27
-rw-r--r--gui/greeter/greeter_item_clock.c68
-rw-r--r--gui/greeter/greeter_item_clock.h27
-rw-r--r--gui/greeter/greeter_item_customlist.c659
-rw-r--r--gui/greeter/greeter_item_customlist.h28
-rw-r--r--gui/greeter/greeter_item_pam.c431
-rw-r--r--gui/greeter/greeter_item_pam.h36
-rw-r--r--gui/greeter/greeter_item_timed.c152
-rw-r--r--gui/greeter/greeter_item_timed.h29
-rw-r--r--gui/greeter/greeter_item_ulist.c464
-rw-r--r--gui/greeter/greeter_item_ulist.h32
-rw-r--r--gui/greeter/greeter_parser.c1911
-rw-r--r--gui/greeter/greeter_parser.h47
-rw-r--r--gui/greeter/greeter_session.c268
-rw-r--r--gui/greeter/greeter_session.h26
-rw-r--r--gui/greeter/greeter_system.c533
-rw-r--r--gui/greeter/greeter_system.h29
-rw-r--r--gui/greeter/themes/.cvsignore3
-rw-r--r--gui/greeter/themes/Makefile.am2
-rw-r--r--gui/greeter/themes/circles/.cvsignore3
-rw-r--r--gui/greeter/themes/circles/GdmGreeterTheme.desktop.in11
-rw-r--r--gui/greeter/themes/circles/Makefile.am19
-rw-r--r--gui/greeter/themes/circles/background.svg39
-rw-r--r--gui/greeter/themes/circles/circles.xml105
-rw-r--r--gui/greeter/themes/circles/flower.pngbin120376 -> 0 bytes
-rw-r--r--gui/greeter/themes/circles/help.pngbin2138 -> 0 bytes
-rw-r--r--gui/greeter/themes/circles/options.pngbin2297 -> 0 bytes
-rw-r--r--gui/greeter/themes/circles/screenshot.pngbin16847 -> 0 bytes
-rw-r--r--gui/greeter/themes/happygnome-list/.cvsignore3
-rw-r--r--gui/greeter/themes/happygnome-list/GdmGreeterTheme.desktop.in11
-rw-r--r--gui/greeter/themes/happygnome-list/Makefile.am18
-rw-r--r--gui/greeter/themes/happygnome-list/background.svg39
-rw-r--r--gui/greeter/themes/happygnome-list/gnome-logo.svg33
-rw-r--r--gui/greeter/themes/happygnome-list/happygnome.xml128
-rw-r--r--gui/greeter/themes/happygnome-list/options.pngbin1619 -> 0 bytes
-rw-r--r--gui/greeter/themes/happygnome-list/screenshot.pngbin12711 -> 0 bytes
-rw-r--r--gui/greeter/themes/happygnome/.cvsignore3
-rw-r--r--gui/greeter/themes/happygnome/GdmGreeterTheme.desktop.in11
-rw-r--r--gui/greeter/themes/happygnome/Makefile.am18
-rw-r--r--gui/greeter/themes/happygnome/background.svg39
-rw-r--r--gui/greeter/themes/happygnome/gnome-logo.svg33
-rw-r--r--gui/greeter/themes/happygnome/happygnome.xml117
-rw-r--r--gui/greeter/themes/happygnome/options.pngbin1619 -> 0 bytes
-rw-r--r--gui/greeter/themes/happygnome/screenshot.pngbin7217 -> 0 bytes
-rw-r--r--gui/login-photo.pngbin2232 -> 0 bytes
-rw-r--r--gui/misc.c116
-rw-r--r--gui/misc.h27
-rw-r--r--gui/modules/.cvsignore6
-rw-r--r--gui/modules/AccessDwellMouseEvents.in59
-rw-r--r--gui/modules/AccessKeyMouseEvents.in86
-rw-r--r--gui/modules/Makefile.am88
-rw-r--r--gui/modules/dwellmouselistener.c760
-rw-r--r--gui/modules/keymouselistener.c1010
131 files changed, 0 insertions, 46120 deletions
diff --git a/gui/.cvsignore b/gui/.cvsignore
deleted file mode 100644
index 91980f1e..00000000
--- a/gui/.cvsignore
+++ /dev/null
@@ -1,22 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-gdmchooser.gladep
-gdmphotosetup.gladep
-gdmsetup.gladep
-gdmphotosetup
-gdmgreeter
-gdmlogin
-gdmchooser
-gdmconfig
-gdmconfig.desktop
-gdmsetup
-gdmsetup.desktop
-gdmsetup.desktop.in
-gdmphotosetup.desktop
-gdmflexiserver.desktop
-gdmflexiserver-xnest.desktop
-gdmflexiserver
-gdmXnestchooser
-gdmdynamic
diff --git a/gui/Makefile.am b/gui/Makefile.am
deleted file mode 100644
index 17877922..00000000
--- a/gui/Makefile.am
+++ /dev/null
@@ -1,248 +0,0 @@
-SUBDIRS = . greeter modules faces
-
-## Process this file with automake to produce makefile.in
-DEFS = @DEFS@ \
- -DPREFIX=\"@prefix@\" \
- -DAUTHDIR=\"@authdir@\" \
- -DDATADIR=\"@datadir@\" \
- -DDMCONFDIR=\"@dmconfdir@\" \
- -DGDMLOCALEDIR=\"@gdmlocaledir@\" \
- -DGDM_GLADE_DIR=\"@datadir@/gdm\" \
- -DLIBDIR=\"@libdir@\" \
- -DLIBEXECDIR=\"@libexecdir@\" \
- -DPIXMAPDIR=\"@pixmapdir@\" \
- -DSBINDIR=\"@sbindir@\"
-
-INCLUDES = \
- -I. \
- -I.. \
- -I$(top_srcdir)/daemon \
- -I$(top_srcdir)/vicious-extensions \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(GUI_CFLAGS)
-
-#
-# -DG_DISABLE_DEPRECATED \
-# -DGDK_DISABLE_DEPRECATED \
-# -DGDK_PIXBUF_DISABLE_DEPRECATED \
-# -DGTK_DISABLE_DEPRECATED \
-# -DGNOME_DISABLE_DEPRECATED \
-#
-
-noinst_LIBRARIES = libgdmwm.a libgdmcommon.a
-
-libexec_PROGRAMS = \
- @GDMCHOOSER@ \
- gdmlogin
-
-sbin_PROGRAMS = \
- gdmsetup
-
-bin_PROGRAMS = \
- gdmphotosetup \
- @GDMXNESTCHOOSER@ \
- gdmflexiserver \
- gdmdynamic
-EXTRA_PROGRAMS = gdmchooser gdmXnestchooser
-
-gdmphotosetup_SOURCES = \
- gdmphotosetup.c
-
-gdmXnestchooser_SOURCES = \
- gdmXnestchooser.c
-
-gdmflexiserver_SOURCES = \
- gdmflexiserver.c
-
-gdmdynamic_SOURCES = \
- gdmdynamic.c
-
-libgdmwm_a_SOURCES = \
- gdmwm.c \
- gdmwm.h
-
-libgdmcommon_a_SOURCES = \
- gdmlanguages.c \
- gdmlanguages.h \
- gdmuser.c \
- gdmuser.h \
- gdmsession.c \
- gdmsession.h \
- misc.c \
- misc.h \
- gdmcomm.c \
- gdmcomm.h \
- gdmconfig.c \
- gdmconfig.h \
- gdmcommon.c \
- gdmcommon.h
-
-gdmchooser_SOURCES = \
- gdmchooser.c \
- misc.c \
- misc.h
-
-gdmlogin_SOURCES = \
- gdmlogin.c
-
-gdmsetup_SOURCES = \
- gdmsetup.c
-
-gdmchooser_LDFLAGS = -export-dynamic
-gdmchooser_LDADD = \
- $(EXTRA_CHOOSER_LIBS) \
- libgdmwm.a \
- libgdmcommon.a \
- $(GUIGLADE_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(PANGO_LIBS) \
- $(GDK_LIBS) \
- $(GDKPIXBUF_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui.a \
- $(X_EXTRA_LIBS) \
- $(XINERAMA_LIBS) \
- $(X_LIBS) \
- $(XDMCP_LIBS) \
- -lX11 \
- -lpopt
-
-gdmlogin_LDADD = \
- libgdmwm.a \
- libgdmcommon.a \
- $(GUING_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(GDK_LIBS) \
- $(PANGO_LIBS) \
- $(GDKPIXBUF_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui-minimal.a \
- $(X_EXTRA_LIBS) \
- $(XINERAMA_LIBS) \
- $(X_LIBS) \
- -lX11
-
-# LIBGNOMEUI should be removed from gdmsetup at some point.
-# It is needed because it uses gnome_help_display_uri(), which
-# should be replaced at some point.
-#
-gdmsetup_CFLAGS = $(LIBGNOMEUI_CFLAGS)
-gdmsetup_LDFLAGS = -export-dynamic
-gdmsetup_LDADD = \
- libgdmcommon.a \
- $(GUI_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(PANGO_LIBS) \
- $(GDK_LIBS) \
- $(GDKPIXBUF_LIBS) \
- $(EXTRA_SETUP_LIBS) \
- $(LIBGNOMEUI_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui.a \
- $(X_LIBS) \
- -lXau \
- -lX11
-
-gdmphotosetup_LDADD = \
- libgdmcommon.a \
- $(GUI_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(GDK_LIBS) \
- $(GDKPIXBUF_LIBS) \
- $(INTLLIBS) \
- -lX11 \
- $(top_builddir)/vicious-extensions/libviciousui.a
-
-gdmXnestchooser_LDADD = \
- libgdmcommon.a \
- $(GUI_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(GDK_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui.a \
- $(EXTRA_XNEST_LIBS) \
- $(X_LIBS) \
- -lXau \
- -lX11 \
- -lpopt
-
-gdmflexiserver_LDADD = \
- libgdmcommon.a \
- $(GUI_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(GDK_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui.a \
- $(EXTRA_FLEXI_LIBS) \
- $(X_LIBS) \
- -lX11 \
- -lXau \
- -lpopt
-
-gdmdynamic_LDADD = \
- libgdmcommon.a \
- $(GUI_LIBS) \
- $(INTLLIBS) \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(GDK_LIBS) \
- $(top_builddir)/vicious-extensions/libviciousui.a \
- $(EXTRA_DYNAMIC_LIBS) \
- $(X_LIBS) \
- -lX11 \
- -lXau
-
-Settingsdir = $(datadir)/applications
-Settings_files = gdmphotosetup.desktop
-Settings_in_files = gdmphotosetup.desktop.in
-Settings_DATA = $(Settings_in_files:.desktop.in=.desktop)
-
-Systemdir = $(datadir)/applications
-System_files = \
- gdmsetup.desktop \
- gdmflexiserver.desktop \
- gdmflexiserver-xnest.desktop
-System_dist_files = \
- gdmsetup.desktop.in.in \
- gdmflexiserver.desktop.in \
- gdmflexiserver-xnest.desktop.in.in
-System_DATA = $(System_files)
-
-CLEANFILES = gdmsetup.desktop gdmsetup.desktop.in gdmflexiserver.desktop gdmflexiserver-xnest.desktop gdmflexiserver-xnest.desktop.in gdmphotosetup.desktop
-
-gdmsetup.desktop.in: $(srcdir)/gdmsetup.desktop.in.in
- sed -e 's,[@]sbindir[@],$(sbindir),g' <$(srcdir)/gdmsetup.desktop.in.in \
- >gdmsetup.desktop.in
-
-@INTLTOOL_DESKTOP_RULE@
-
-Gladedir = $(datadir)/gdm
-Glade_DATA = gdmsetup.glade gdmchooser.glade gdmphotosetup.glade
-
-Iconsdir = $(datadir)/pixmaps
-
-Icons_DATA = \
- login-photo.png
-
-install-data-local:
- -test -z "$(DESTDIR)$(bindir)/gdmXnest" || rm -f $(DESTDIR)$(bindir)/gdmXnest
- $(LN_S) -f gdmXnestchooser $(DESTDIR)$(bindir)/gdmXnest
-
-EXTRA_DIST = \
- $(Glade_DATA) \
- $(Icons_DATA) \
- $(System_DATA) \
- $(System_dist_files) \
- $(Settings_DATA) \
- $(Settings_files) \
- $(Settings_in_files)
-
-clean-local:
- rm -f $(System_files) $(Settings_files)
diff --git a/gui/faces/.cvsignore b/gui/faces/.cvsignore
deleted file mode 100644
index 282522db..00000000
--- a/gui/faces/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-Makefile
-Makefile.in
diff --git a/gui/faces/Makefile.am b/gui/faces/Makefile.am
deleted file mode 100644
index c7022b33..00000000
--- a/gui/faces/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-
-imagedir = $(datadir)/pixmaps/faces
-
-image_DATA = \
- astronaut.jpg \
- baseball.png \
- butterfly.png \
- cat-eye.jpg \
- chess.jpg \
- coffee.jpg \
- dice.jpg \
- energy-arc.jpg \
- fish.jpg \
- flake.jpg \
- flower.jpg \
- grapes.jpg \
- guitar.jpg \
- launch.jpg \
- leaf.jpg \
- lightning.jpg \
- penguin.jpg \
- puppy.jpg \
- sky.jpg \
- soccerball.png \
- sunflower.jpg \
- sunset.jpg \
- tennis-ball.png \
- yellow-rose.jpg
-
-EXTRA_DIST = \
- $(image_DATA)
-
diff --git a/gui/faces/astronaut.jpg b/gui/faces/astronaut.jpg
deleted file mode 100644
index 4b79f0e2..00000000
--- a/gui/faces/astronaut.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/baseball.png b/gui/faces/baseball.png
deleted file mode 100644
index 0d6dfdb9..00000000
--- a/gui/faces/baseball.png
+++ /dev/null
Binary files differ
diff --git a/gui/faces/butterfly.png b/gui/faces/butterfly.png
deleted file mode 100644
index 66b813cc..00000000
--- a/gui/faces/butterfly.png
+++ /dev/null
Binary files differ
diff --git a/gui/faces/cat-eye.jpg b/gui/faces/cat-eye.jpg
deleted file mode 100644
index c818bd5e..00000000
--- a/gui/faces/cat-eye.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/chess.jpg b/gui/faces/chess.jpg
deleted file mode 100644
index 7abb8a4d..00000000
--- a/gui/faces/chess.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/coffee.jpg b/gui/faces/coffee.jpg
deleted file mode 100644
index 46e8fc5c..00000000
--- a/gui/faces/coffee.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/dice.jpg b/gui/faces/dice.jpg
deleted file mode 100644
index 641b124a..00000000
--- a/gui/faces/dice.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/energy-arc.jpg b/gui/faces/energy-arc.jpg
deleted file mode 100644
index 9f4c892e..00000000
--- a/gui/faces/energy-arc.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/fish.jpg b/gui/faces/fish.jpg
deleted file mode 100644
index fc363d66..00000000
--- a/gui/faces/fish.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/flake.jpg b/gui/faces/flake.jpg
deleted file mode 100644
index 5546d7e3..00000000
--- a/gui/faces/flake.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/flower.jpg b/gui/faces/flower.jpg
deleted file mode 100644
index 3e41ba4e..00000000
--- a/gui/faces/flower.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/grapes.jpg b/gui/faces/grapes.jpg
deleted file mode 100644
index 3d31daff..00000000
--- a/gui/faces/grapes.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/guitar.jpg b/gui/faces/guitar.jpg
deleted file mode 100644
index 9e8834f7..00000000
--- a/gui/faces/guitar.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/launch.jpg b/gui/faces/launch.jpg
deleted file mode 100644
index 7c7bf434..00000000
--- a/gui/faces/launch.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/leaf.jpg b/gui/faces/leaf.jpg
deleted file mode 100644
index 53541033..00000000
--- a/gui/faces/leaf.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/lightning.jpg b/gui/faces/lightning.jpg
deleted file mode 100644
index 736ccd5b..00000000
--- a/gui/faces/lightning.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/penguin.jpg b/gui/faces/penguin.jpg
deleted file mode 100644
index 2a8dfd6a..00000000
--- a/gui/faces/penguin.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/puppy.jpg b/gui/faces/puppy.jpg
deleted file mode 100644
index ab55a8b8..00000000
--- a/gui/faces/puppy.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/sky.jpg b/gui/faces/sky.jpg
deleted file mode 100644
index 841f90e4..00000000
--- a/gui/faces/sky.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/soccerball.png b/gui/faces/soccerball.png
deleted file mode 100644
index 56588a98..00000000
--- a/gui/faces/soccerball.png
+++ /dev/null
Binary files differ
diff --git a/gui/faces/sunflower.jpg b/gui/faces/sunflower.jpg
deleted file mode 100644
index 6102b8ba..00000000
--- a/gui/faces/sunflower.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/sunset.jpg b/gui/faces/sunset.jpg
deleted file mode 100644
index 48b6223f..00000000
--- a/gui/faces/sunset.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/faces/tennis-ball.png b/gui/faces/tennis-ball.png
deleted file mode 100644
index a1beb50e..00000000
--- a/gui/faces/tennis-ball.png
+++ /dev/null
Binary files differ
diff --git a/gui/faces/yellow-rose.jpg b/gui/faces/yellow-rose.jpg
deleted file mode 100644
index 7f1de963..00000000
--- a/gui/faces/yellow-rose.jpg
+++ /dev/null
Binary files differ
diff --git a/gui/gdmXnestchooser.c b/gui/gdmXnestchooser.c
deleted file mode 100644
index 338b553c..00000000
--- a/gui/gdmXnestchooser.c
+++ /dev/null
@@ -1,678 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (c) 2001 Queen of England
- *
- * GDMXnestChooser - run X nest with a chooser using xdmcp
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-#include <glib/gi18n.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <errno.h>
-#include <X11/Xauth.h>
-
-#include "gdm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-
-static gchar **args_remaining;
-static pid_t xnest_pid = 0;
-
-#ifdef ENABLE_IPV6
-static gboolean
-have_ipv6 () {
- gint s;
-
- s = socket (AF_INET6, SOCK_STREAM, 0);
-
- if (s != -1) {
- VE_IGNORE_EINTR (close (s));
- return TRUE;
- }
-
- return FALSE;
-}
-#endif
-
-static void
-term_handler (int sig)
-{
- if (xnest_pid != 0)
- kill (xnest_pid, SIGTERM);
- else
- exit (0);
-}
-
-static int
-get_free_display (void)
-{
- int sock;
- int i;
- struct sockaddr_in serv_addr = {0};
-
- serv_addr.sin_family = AF_INET;
- serv_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
-
- for (i = 20; i < 3000; i++) {
- struct stat s;
- char buf[256];
- FILE *fp;
-#ifdef ENABLE_IPV6
- if (have_ipv6()) {
- struct sockaddr_in6 serv6_addr = {0};
-
- sock = socket (AF_INET6, SOCK_STREAM, 0);
- serv6_addr.sin6_family = AF_INET6;
- serv6_addr.sin6_addr = in6addr_loopback;
- serv6_addr.sin6_port = htons (6000 + i);
-
- if (connect (sock, (struct sockaddr *)&serv6_addr, sizeof (serv6_addr)) >= 0 || errno != ECONNREFUSED) {
- VE_IGNORE_EINTR (close (sock));
- continue;
- }
- }
- else
-#endif
- {
-
- sock = socket (AF_INET, SOCK_STREAM, 0);
-
- serv_addr.sin_port = htons (6000 + i);
-
- errno = 0;
- if (connect (sock, (struct sockaddr *)&serv_addr,
- sizeof (serv_addr)) >= 0 ||
- errno != ECONNREFUSED) {
- VE_IGNORE_EINTR (close (sock));
- continue;
- }
- }
-
- VE_IGNORE_EINTR (close (sock));
-
- /* if lock file exists and the process exists */
- g_snprintf (buf, sizeof (buf), "/tmp/.X%d-lock", i);
- VE_IGNORE_EINTR (fp = fopen (buf, "r"));
- if (fp != NULL) {
- char buf2[100];
- if (fgets (buf2, sizeof (buf2), fp) != NULL) {
- gulong pid;
- if (sscanf (buf2, "%lu", &pid) == 1 &&
- kill (pid, 0) == 0) {
- VE_IGNORE_EINTR (fclose (fp));
- continue;
- }
-
- }
- VE_IGNORE_EINTR (fclose (fp));
- }
-
- g_snprintf (buf, sizeof (buf), "/tmp/.X11-unix/X%d", i);
- if (g_stat (buf, &s) == 0 &&
- s.st_uid != getuid ()) {
- continue;
- }
-
- g_snprintf (buf, sizeof (buf), "/tmp/.X%d-lock", i);
- if (g_stat (buf, &s) == 0 &&
- s.st_uid != getuid ()) {
- continue;
- }
-
- return i;
- }
- fprintf (stderr, "ERROR! Can't find free display!\n");
-
- return -1;
-}
-
-static const char *host = "localhost";
-static char *xnest_binary = NULL;
-static char *xnest_options = NULL;
-static gboolean no_query = FALSE;
-static gboolean background = FALSE;
-static gboolean do_direct = FALSE;
-static gboolean do_broadcast = FALSE;
-static gboolean no_gdm_check = FALSE;
-
-static char display_num[BUFSIZ] = "";
-static char indirect_host[BUFSIZ] = "";
-
-/* options for Xnest only mode */
-static const GOptionEntry xnest_only_options[] = {
- { "xnest", 'x', 0, G_OPTION_ARG_STRING, &xnest_binary, N_("Xnest command line"), N_("STRING") },
- { "xnest-extra-options", 'o', 0, G_OPTION_ARG_STRING, &xnest_options, N_("Extra options for Xnest"), N_("OPTIONS") },
- { "background", 'b', 0, G_OPTION_ARG_NONE, &background, N_("Run in background"), NULL },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL },
- { NULL }
-};
-
-static const GOptionEntry options[] = {
- { "xnest", 'x', 0, G_OPTION_ARG_STRING, &xnest_binary, N_("Xnest command line"), N_("STRING") },
- { "xnest-extra-options", 'o', 0, G_OPTION_ARG_STRING, &xnest_options, N_("Extra options for Xnest"), N_("OPTIONS") },
- { "no-query", 'n', 0, G_OPTION_ARG_NONE, &no_query, N_("Just run Xnest, no query (no chooser)"), NULL },
- { "direct", 'd', 0, G_OPTION_ARG_NONE, &do_direct, N_("Do direct query instead of indirect (chooser)"), NULL },
- { "broadcast", 'B', 0, G_OPTION_ARG_NONE, &do_broadcast, N_("Run broadcast instead of indirect (chooser)"), NULL },
- { "background", 'b', 0, G_OPTION_ARG_NONE, &background, N_("Run in background"), NULL },
- { "no-gdm-check", '\0', 0, G_OPTION_ARG_NONE, &no_gdm_check, N_("Don't check for running GDM"), NULL },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL },
- { NULL }
-};
-
-#if 0
-/* Perhaps this may be useful sometime */
-static gboolean
-test_opt (const char *cmd, const char *help, const char *option)
-{
- char *q = g_shell_quote (cmd);
- char *full;
- char buf[1024];
- FILE *fp;
-
- full = g_strdup_printf ("%s %s 2>&1", q, help);
- g_free (q);
-
- fp = popen (full, "r");
- g_free (full);
-
- if (fp == NULL)
- return FALSE;
-
- while (fgets (buf, sizeof (buf), fp) != NULL) {
- char *p = strstr (buf, option);
- char end;
- if (p == NULL)
- continue;
- /* must be a full word */
- end = *(p + strlen (option));
- if ((end >= 'a' && end <= 'z') ||
- (end >= 'A' && end <= 'Z') ||
- (end >= '0' && end <= '9') ||
- end == '_')
- continue;
-
- fclose (fp);
- return TRUE;
- }
- fclose (fp);
- return FALSE;
-}
-#endif
-
-static char *
-get_font_path (const char *display)
-{
- Display *disp;
- char **font_path;
- int n_fonts;
- int i;
- GString *gs;
-
- disp = XOpenDisplay (display);
- if (disp == NULL)
- return NULL;
-
- font_path = XGetFontPath (disp, &n_fonts);
- if (font_path == NULL) {
- XCloseDisplay (disp);
- return NULL;
- }
-
- gs = g_string_new (NULL);
- for (i = 0; i < n_fonts; i++) {
- if (i != 0)
- g_string_append_c (gs, ',');
- g_string_append (gs, font_path[i]);
- }
-
- XFreeFontPath (font_path);
-
- XCloseDisplay (disp);
-
- return g_string_free (gs, FALSE);
-}
-
-static char **
-make_us_an_exec_vector (const char *xnest)
-{
- char **vector;
- int i, ii;
- int argc;
- char **xnest_vec;
- char **options_vec = NULL;
- gboolean got_font_path = FALSE;
- char *font_path = NULL;
-
- if ( ! ve_string_empty (xnest_binary))
- xnest = xnest_binary;
-
- if (ve_string_empty (xnest))
- xnest = "Xnest";
-
- xnest_vec = ve_split (xnest);
- if (xnest_options != NULL)
- options_vec = ve_split (xnest_options);
- else
- options_vec = NULL;
-
- argc = ve_vector_len (xnest_vec) +
- 1 +
- ve_vector_len (options_vec) +
- 3 +
- 2;
-
- vector = g_new0 (char *, argc);
-
- ii = 0;
-
- /* lots of leaks follow */
-
- vector[ii++] = xnest_vec[0];
- vector[ii++] = display_num;
-
- for (i = 1; xnest_vec[i] != NULL; i++) {
- vector[ii++] = xnest_vec[i];
- if (strcmp (xnest_vec[i], "-fp") == 0)
- got_font_path = TRUE;
- }
-
- if (options_vec != NULL) {
- for (i = 0; options_vec[i] != NULL; i++) {
- vector[ii++] = options_vec[i];
- if (strcmp (options_vec[i], "-fp") == 0)
- got_font_path = TRUE;
- }
- }
-
- if ( ! no_query) {
- if (do_broadcast) {
- vector[ii++] = "-broadcast";
- } else if (do_direct) {
- vector[ii++] = "-query";
- vector[ii++] = indirect_host;
- } else {
- vector[ii++] = "-indirect";
- vector[ii++] = indirect_host;
- }
- }
-
- if ( ! got_font_path)
- font_path = get_font_path (NULL);
-
- if (font_path != NULL) {
- vector[ii++] = "-fp";
- vector[ii++] = font_path;
- }
-
- return vector;
-}
-
-static const char *
-base (const char *s)
-{
- const char *p = strchr (s, '/');
- if (p == NULL)
- return s;
- return p+1;
-}
-
-static const char *
-xauth_path (void)
-{
- static char *xauth_path = NULL;
- if (xauth_path == NULL)
- xauth_path = g_find_program_in_path ("xauth");
- return xauth_path;
-}
-
-static void
-whack_cookie (int display)
-{
- char *command;
-
- if (xauth_path () == NULL) {
- return;
- }
-
- command = g_strdup_printf ("%s remove :%d",
- xauth_path (),
- display);
- system (command);
- g_free (command);
-}
-
-static Xauth *
-get_auth_entry (int disp, char *cookie)
-{
- Xauth *xa;
- gchar *dispnum;
- char hostname [1024];
-
- xa = malloc (sizeof (Xauth));
-
- if (xa == NULL)
- return NULL;
-
- hostname[1023] = '\0';
- if (gethostname (hostname, 1023) != 0) {
- strcpy (hostname, "localhost");
- }
-
- xa->family = FamilyLocal;
- xa->address = malloc (strlen (hostname) + 1);
- if (xa->address == NULL) {
- free (xa);
- return NULL;
- }
-
- strcpy (xa->address, hostname);
- xa->address_length = strlen (hostname);;
-
- dispnum = g_strdup_printf ("%d", disp);
- xa->number = strdup (dispnum);
- xa->number_length = strlen (dispnum);
- g_free (dispnum);
-
- xa->name = strdup ("MIT-MAGIC-COOKIE-1");
- xa->name_length = strlen ("MIT-MAGIC-COOKIE-1");
- xa->data = malloc (16);
- if (xa->data == NULL) {
- free (xa->number);
- free (xa->name);
- free (xa->address);
- free (xa);
- return NULL;
- }
- memcpy (xa->data, cookie, 16);
- xa->data_length = 16;
-
- return xa;
-}
-
-static void
-setup_cookie (int disp)
-{
- char *cookie;
- FILE *af;
- Xauth *xa;
- const char *filename = XauFileName ();
- if (filename == NULL)
- return;
-
- if (XauLockAuth (filename, 3, 3, 0) != LOCK_SUCCESS)
- return;
-
- cookie = gdmcomm_get_a_cookie (TRUE /* binary */);
- if (cookie == NULL) {
- XauUnlockAuth (filename);
- return;
- }
-
- VE_IGNORE_EINTR (af = fopen (filename, "a+"));
- if (af == NULL) {
- XauUnlockAuth (filename);
- g_free (cookie);
- return;
- }
-
- xa = get_auth_entry (disp, cookie);
- if (xa == NULL) {
- g_free (cookie);
- VE_IGNORE_EINTR (fclose (af));
- XauUnlockAuth (filename);
- return;
- }
-
- g_free (cookie);
-
- XauWriteAuth (af, xa);
-
- XauDisposeAuth (xa);
-
- VE_IGNORE_EINTR (fclose (af));
-
- XauUnlockAuth (filename);
-}
-
-int
-main (int argc, char *argv[])
-{
- gboolean xdmcp_enabled;
- gboolean honor_indirect;
- int display;
- char *socket;
- char *pidfile;
- GOptionContext *ctx;
- char *xnest;
- char **execvec;
- struct sigaction term;
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- if (strcmp (base (argv[0]), "gdmXnest") == 0) {
- gtk_init(&argc, &argv);
- ctx = g_option_context_new (_("- Nested gdm login chooser"));
- g_option_context_add_main_entries (ctx, xnest_only_options, _("main options"));
- g_option_context_parse (ctx, &argc, &argv, NULL);
- g_option_context_free (ctx);
- no_query = TRUE;
- no_gdm_check = TRUE;
- } else {
- gtk_init(&argc, &argv);
- ctx = g_option_context_new (_("- Nested gdm login"));
- g_option_context_add_main_entries (ctx, options, _("main options"));
- g_option_context_parse (ctx, &argc, &argv, NULL);
- g_option_context_free (ctx);
- }
-
- if (args_remaining != NULL && args_remaining[0] != NULL)
- host = args_remaining[0];
- g_strfreev (args_remaining);
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- xdmcp_enabled = gdm_config_get_bool (GDM_KEY_XDMCP);
- honor_indirect = gdm_config_get_bool (GDM_KEY_INDIRECT);
- xnest = gdm_config_get_string (GDM_KEY_XNEST);
- pidfile = GDM_PID_FILE;
-
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
-
- /* complex and wonderous way to get the exec vector */
- execvec = make_us_an_exec_vector (xnest);
-
- if (execvec == NULL) {
- GtkWidget *d;
- d = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Xnest doesn't exist."),
- _("Please ask your system "
- "administrator "
- "to install it."));
- gtk_widget_show_all (d);
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- return 0;
- }
-
- if ( ! no_query &&
- ! do_broadcast &&
- ! no_gdm_check &&
- strcmp (host, "localhost") == 0) {
- FILE *fp = NULL;
- long pid;
-
- if (( ! xdmcp_enabled ||
- ! honor_indirect) &&
- ! do_direct) {
- GtkWidget *d;
- d = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Indirect XDMCP is not enabled"),
- _("Please ask your "
- "system administrator to enable "
- "this feature."));
- gtk_widget_show_all (d);
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- return 0;
- }
-
- if ( ! xdmcp_enabled &&
- do_direct) {
- GtkWidget *d;
- d = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("XDMCP is not enabled"),
- _("Please ask your "
- "system administrator to enable "
- "this feature."));
- gtk_widget_show_all (d);
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- return 0;
- }
-
- pid = 0;
- if (pidfile != NULL) {
- VE_IGNORE_EINTR (fp = fopen (pidfile, "r"));
- }
- if (fp != NULL) {
- int r;
- VE_IGNORE_EINTR (r = fscanf (fp, "%ld", &pid));
- VE_IGNORE_EINTR (fclose (fp));
- if (r != 1)
- pid = 0;
- }
-
- errno = 0;
- if (pid <= 1 ||
- (kill (pid, 0) < 0 &&
- errno != EPERM)) {
- GtkWidget *d;
- d = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("GDM is not running"),
- _("Please ask your "
- "system administrator to start it."));
- gtk_widget_show_all (d);
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- return 0;
- }
- }
-
- display = get_free_display ();
- if (display < 0) {
- GtkWidget *d;
- d = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Could not find a free "
- "display number"),
- "");
- gtk_widget_show_all (d);
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- return 0;
- }
-
- printf ("DISPLAY=:%d\n", display);
- fflush (stdout);
-
- g_snprintf (display_num, sizeof (display_num), ":%d", display);
- g_snprintf (indirect_host, sizeof (indirect_host), "%s", host);
-
- if (no_query) {
- whack_cookie (display);
- setup_cookie (display);
- }
-
- if (background) {
- if (fork () > 0) {
- _exit (0);
- }
- VE_IGNORE_EINTR (close (0));
- VE_IGNORE_EINTR (close (1));
- VE_IGNORE_EINTR (close (2));
- VE_IGNORE_EINTR (open ("/dev/null", O_RDWR));
- VE_IGNORE_EINTR (open ("/dev/null", O_RDONLY));
- VE_IGNORE_EINTR (open ("/dev/null", O_RDONLY));
- }
-
- term.sa_handler = term_handler;
- term.sa_flags = SA_RESTART;
- sigemptyset (&term.sa_mask);
-
- sigaction (SIGTERM, &term, NULL);
- sigaction (SIGINT, &term, NULL);
- sigaction (SIGHUP, &term, NULL);
-
- xnest_pid = fork ();
- if (xnest_pid == 0) {
- execvp (execvec[0], execvec);
- g_warning ("Can't exec, trying Xnest");
- execvec[0] = "Xnest";
- execvp (execvec[0], execvec);
- g_warning ("Can't exec that either, giving up");
- /* FIXME: this should be handled in the GUI */
- _exit (1);
- } else if (xnest_pid < 0) {
- /* eeeek */
- g_warning ("Can't fork");
- _exit (1);
- }
-
- ve_waitpid_no_signal (xnest_pid, NULL, 0);
- xnest_pid = 0;
-
- socket = g_strdup_printf ("/tmp/.X11-unix/X%d", display);
- g_unlink (socket);
- g_free (socket);
-
- if (no_query)
- whack_cookie (display);
-
- return 0;
-}
diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c
deleted file mode 100644
index 79c3bc5f..00000000
--- a/gui/gdmchooser.c
+++ /dev/null
@@ -1,2111 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K, Petersen <mkp@mkp.net>
- *
- * 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
- */
-
-/* gdmchooser discovers hosts running XDMCP on the local network (s),
- * presents a list of them and allows the user to choose one. The
- * selected hostname will be printed on stdout. */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dirent.h>
-#include <string.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#ifdef HAVE_SYS_SOCKIO_H
-#include <sys/sockio.h>
-#endif
-
-#include <X11/Xmd.h>
-#include <X11/Xdmcp.h>
-
-#include <gdk/gdkx.h>
-#include <glib/gi18n.h>
-#include <glade/glade.h>
-
-#include "gdm.h"
-#include "misc.h"
-#include "gdmwm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-
-#include "viciousui.h"
-
-static gboolean RUNNING_UNDER_GDM = FALSE;
-
-enum {
- CHOOSER_LIST_ICON_COLUMN = 0,
- CHOOSER_LIST_LABEL_COLUMN,
- CHOOSER_LIST_HOST_COLUMN
-};
-
-typedef struct _GdmChooserHost GdmChooserHost;
-struct _GdmChooserHost {
- gchar *name;
- gchar *desc;
-#ifdef ENABLE_IPV6
- struct in6_addr ia6;
-#endif
- struct in_addr ia;
- gint addrtype; /* Address stored is IPv4 or IPv6 */
- GdkPixbuf *picture;
- gboolean willing;
-};
-
-
-static const gchar *scanning_message = N_("Please wait: scanning local network...");
-static const gchar *empty_network = N_("No serving hosts were found.");
-static const gchar *active_network = N_("Choose a ho_st to connect to:");
-
-/* XDM chooser style stuff */
-static gchar *xdm_address = NULL;
-static gchar *client_address = NULL;
-static gint connection_type = 0;
-
-/* Exported for glade */
-void gdm_chooser_add_host (void);
-void gdm_chooser_add_entry_changed (void);
-void gdm_chooser_manage (GtkButton *button, gpointer data);
-void gdm_chooser_browser_select (GtkWidget *widget,
- gint selected,
- GdkEvent *event);
-void gdm_chooser_browser_unselect (GtkWidget *widget,
- gint selected,
- GdkEvent *event);
-void gdm_chooser_xdmcp_discover (void);
-void display_chooser_information (void);
-
-#define ADD_TIMEOUT 3000
-static guint add_check_handler = 0;
-
-/* if this is received, select that host automatically */
-#ifdef ENABLE_IPV6
-static struct in6_addr *added6_addr = NULL;
-#endif
-static struct in_addr *added_addr = NULL;
-static char *added_host = NULL;
-
-static guint scan_time_handler = 0;
-
-#define PING_TIMEOUT 2000
-#define PING_TRIES 3
-static int ping_tries = PING_TRIES;
-static guint ping_try_handler = 0;
-
-/* set in the main function */
-static char **stored_argv = NULL;
-static int stored_argc = 0;
-
-/* Fixetyfix */
-int XdmcpReallocARRAY8 (ARRAY8Ptr array, int length);
-
-
-typedef struct _XdmAuth {
- ARRAY8 authentication;
- ARRAY8 authorization;
-} XdmAuthRec, *XdmAuthPtr;
-
-static XdmAuthRec authlist = {
- { (CARD16) 0, (CARD8 *) 0 },
- { (CARD16) 0, (CARD8 *) 0 }
-};
-
-
-static gint sockfd;
-static XdmcpBuffer bcbuf;
-static XdmcpBuffer querybuf;
-static GSList *bcaddr;
-static GSList *queryaddr;
-
-enum {
- GDM_BACKGROUND_NONE = 0,
- GDM_BACKGROUND_IMAGE = 1,
- GDM_BACKGROUND_COLOR = 2
-};
-
-static GladeXML *chooser_app;
-static GtkWidget *chooser, *manage, *rescan, *cancel, *add_entry, *add_button;
-static GtkWidget *status_label;
-
-static GIOChannel *channel;
-static GList *chooser_hosts = NULL;
-static GdkPixbuf *defhostimg;
-static GtkWidget *browser;
-static GtkTreeModel *browser_model;
-static GdmChooserHost *curhost;
-
-static gboolean have_ipv6; /* Socket is IPv4 or IPv6 */
-
-static gboolean
-find_host_in_list (GdmChooserHost *host, GtkTreeIter *iter)
-{
- if (gtk_tree_model_get_iter_first (browser_model, iter)) {
- do {
- GdmChooserHost *lhost;
- gtk_tree_model_get (browser_model, iter,
- CHOOSER_LIST_HOST_COLUMN, &lhost,
- -1);
- if (lhost == host)
- return TRUE;
- } while (gtk_tree_model_iter_next (browser_model, iter));
- }
- return FALSE;
-}
-
-static void
-gdm_chooser_host_dispose (GdmChooserHost *host)
-{
- if (!host)
- return;
-
- if (host->picture != NULL)
- g_object_unref (G_OBJECT (host->picture));
- host->picture = NULL;
-
- g_free (host->name);
- host->name = NULL;
- g_free (host->desc);
- host->desc = NULL;
- g_free (host);
-}
-
-static GdmChooserHost *
-gdm_chooser_host_alloc (const char *hostname,
- const char *description,
- char *ia,
- int family,
- gboolean willing)
-{
- GdmChooserHost *host;
- GdkPixbuf *img;
- gchar *hostimg;
- gchar *hostimgdir;
-
- host = g_new0 (GdmChooserHost, 1);
- host->name = g_strdup (hostname);
- host->desc = g_strdup (description);
- host->willing = willing;
-#ifdef ENABLE_IPV6
- if (family == AF_INET6)
- memcpy (&host->ia6, (struct in6_addr *)ia, sizeof (struct in6_addr));
- else
-#endif
- memcpy (&host->ia, (struct in_addr *)ia, sizeof (struct in_addr));
-
- host->addrtype = family;
- chooser_hosts = g_list_prepend (chooser_hosts, host);
-
- if ( ! willing)
- return host;
-
- hostimgdir = gdm_config_get_string (GDM_KEY_HOST_IMAGE_DIR);
- hostimg = g_strconcat (hostimgdir, "/", hostname, NULL);
- if (g_access (hostimg, R_OK) != 0) {
- g_free (hostimg);
- hostimg = g_strconcat (hostimgdir, "/", hostname, ".png", NULL);
- }
-
- if (g_access (hostimg, R_OK) == 0 &&
- (img = gdk_pixbuf_new_from_file (hostimg, NULL)) != NULL) {
- gint w, h, maxw, maxh;
-
- w = gdk_pixbuf_get_width (img);
- h = gdk_pixbuf_get_height (img);
-
- maxw = gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- maxh = gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
-
- if (w > h && w > maxw) {
- h = h * ((gfloat) maxw / w);
- w = maxw;
- } else if (h > maxh) {
- w = w * ((gfloat) maxh / h);
- h = maxh;
- }
-
-
- if (w != gdk_pixbuf_get_width (img) ||
- h != gdk_pixbuf_get_height (img))
- host->picture = gdk_pixbuf_scale_simple (img, w, h,
- GDK_INTERP_BILINEAR);
- else
- host->picture = g_object_ref (G_OBJECT (img));
-
- g_object_unref (G_OBJECT (img));
- } else if (defhostimg != NULL) {
- host->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defhostimg));
- }
-
- g_free (hostimg);
-
- return host;
-}
-
-static void
-gdm_chooser_browser_add_host (GdmChooserHost *host)
-{
- gboolean add_this_host = FALSE;
-
- if (host->willing) {
- GtkTreeIter iter = {0};
- const char *addr;
- char *label;
- char *name, *desc;
-#ifdef ENABLE_IPV6
- if (host->addrtype == AF_INET6) { /* IPv6 address */
- static char buffer6[INET6_ADDRSTRLEN];
-
- addr = inet_ntop (AF_INET6, host->ia6.s6_addr, buffer6, INET6_ADDRSTRLEN);
- }
- else /* IPv4 address */
-#endif
- {
- addr = inet_ntoa (host->ia);
- }
-
- name = g_markup_escape_text (host->name, -1);
- desc = g_markup_escape_text (host->desc, -1);
-
- if (strcmp (addr, host->name) == 0)
- label = g_strdup_printf ("<b>%s</b>\n%s",
- name,
- desc);
- else
- label = g_strdup_printf ("<b>%s</b> (%s)\n%s",
- name,
- addr,
- desc);
-
- g_free (name);
- g_free (desc);
-
- gtk_list_store_append (GTK_LIST_STORE (browser_model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (browser_model), &iter,
- CHOOSER_LIST_ICON_COLUMN, host->picture,
- CHOOSER_LIST_LABEL_COLUMN, label,
- CHOOSER_LIST_HOST_COLUMN, host,
- -1);
- g_free (label);
-
-#ifdef ENABLE_IPV6
- if (added6_addr != NULL && memcmp (&host->ia6, added6_addr,
- sizeof (struct in6_addr)) == 0) {
- added6_addr = NULL;
- add_this_host = TRUE;
- }
-#else
- if (added_addr != NULL &&
- memcmp (&host->ia, added_addr,
- sizeof (struct in_addr)) == 0) {
- added_addr = NULL;
- add_this_host = TRUE;
- }
-#endif
- if (add_this_host) {
- GtkTreeSelection *selection;
- GtkTreePath *path = gtk_tree_model_get_path (browser_model, &iter);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- gtk_widget_grab_focus (manage);
- }
- g_free (added_host);
- added_host = NULL;
- if (add_check_handler > 0)
- g_source_remove (add_check_handler);
- add_check_handler = 0;
- }
-
- gtk_widget_set_sensitive (GTK_WIDGET (browser), TRUE);
-}
-
-static GdmChooserHost *
-gdm_host_known (char *ia, gint family)
-{
- GList *li;
-
- for (li = chooser_hosts; li != NULL; li = li->next) {
- GdmChooserHost *host = li->data;
-#ifdef ENABLE_IPV6
- if (family == AF_INET6) {
- if (host->addrtype != AF_INET6)
- continue;
- if ( ! memcmp (&host->ia6, (struct in6_addr *)ia, sizeof (struct in6_addr)))
- return host;
- }
- else
-#endif
- if (family == AF_INET) {
- if (host->addrtype != AF_INET)
- continue;
- if ( ! memcmp (&host->ia, (struct in_addr *)ia, sizeof (struct in_addr)))
- return host;
- }
- }
- return NULL;
-}
-
-static gboolean
-is_loopback_addr (char *ia, gint family)
-{
- const char lo[] = {127,0,0,1};
-
-#ifdef ENABLE_IPV6
- if (family == AF_INET6 && IN6_IS_ADDR_LOOPBACK ((struct in6_addr *)ia)) {
- return TRUE;
- } else
-#endif
- if (((family == AF_INET) && (((struct in_addr *) ia)->s_addr == INADDR_LOOPBACK)) || memcmp (&((struct in_addr *)ia)->s_addr, lo, 4) == 0) {
- return TRUE;
- }
- else {
- return FALSE;
- }
-}
-
-static gboolean
-gdm_addr_known (char *ia, gint family)
-{
- GSList *li;
-
- for (li = queryaddr; li != NULL; li = li->next) {
- struct sockaddr *sa = li->data;
-
-#ifdef ENABLE_IPV6
- if (sa->sa_family == AF_INET6) {
- if (family != AF_INET6)
- continue;
-
- if (!memcmp (&((struct sockaddr_in6 *)sa)->sin6_addr, (struct in6_addr *)ia , sizeof (struct in6_addr)))
- return TRUE;
- }
- else if (sa->sa_family == AF_INET) {
- if (family != AF_INET)
- continue;
-
- if (!memcmp (&((struct sockaddr_in *)sa)->sin_addr, (struct in_addr *)ia, sizeof (struct in_addr)))
- return TRUE;
-
- }
-#else
- if (memcmp (&((struct sockaddr_in *)sa)->sin_addr, (struct in_addr *)ia, sizeof (struct in_addr)) == 0)
- return TRUE;
-#endif
- }
- return FALSE;
-}
-
-static gboolean
-gdm_chooser_decode_packet (GIOChannel *source,
- GIOCondition condition,
- gpointer data)
-{
-#ifdef ENABLE_IPV6
- char hbuf[NI_MAXHOST];
- struct sockaddr_in6 clnt6_sa;
-#endif
- struct sockaddr_in clnt_sa;
- gint sa_len;
- static XdmcpBuffer buf;
- XdmcpHeader header;
- struct hostent *he;
- gchar *hostname = NULL;
- gchar *status = NULL;
- ARRAY8 auth = {0}, host = {0}, stat = {0};
- GdmChooserHost *gh;
- int pipe_buf;
- gboolean host_not_willing = FALSE;
-
-#ifdef PIPE_BUF
- pipe_buf = PIPE_BUF;
-#else
- /* apparently Hurd doesn't have PIPE_BUF */
- pipe_buf = fpathconf (1 /*stdout*/, _PC_PIPE_BUF);
- /* could return -1 if no limit */
-#endif
-
- if ( ! (condition & G_IO_IN))
- return TRUE;
-
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- sa_len = sizeof (struct sockaddr_in6);
- if (! XdmcpFill (sockfd, &buf, (XdmcpNetaddr) &clnt6_sa, &sa_len))
- return TRUE;
- } else
-#endif
- {
- sa_len = sizeof (struct sockaddr_in);
- if (! XdmcpFill (sockfd, &buf, (XdmcpNetaddr) &clnt_sa, &sa_len))
- return TRUE;
- }
-
- if (! XdmcpReadHeader (&buf, &header))
- return TRUE;
-
- if (header.version != XDM_PROTOCOL_VERSION)
- return TRUE;
-
- if (header.opcode == WILLING) {
- if (! XdmcpReadARRAY8 (&buf, &auth))
- goto done;
-
- if (! XdmcpReadARRAY8 (&buf, &host))
- goto done;
-
- if (! XdmcpReadARRAY8 (&buf, &stat))
- goto done;
-
- status = g_strndup ((char *) stat.data, MIN (stat.length, 256));
- } else if (header.opcode == UNWILLING) {
- /* immaterial, will not be shown */
- status = NULL;
- } else {
- return TRUE;
- }
-#ifdef ENABLE_IPV6
- /*Since, IPv4 addresses will get extracted as V4 mapped IPv6 address*/
-
- if (have_ipv6 &&
- IN6_IS_ADDR_V4MAPPED (&(clnt6_sa.sin6_addr))) {
- memset (&clnt_sa, 0, sizeof (clnt_sa));
- memcpy (&(clnt_sa.sin_addr), &(clnt6_sa.sin6_addr.s6_addr[12]), 4);
- clnt_sa.sin_family = AF_INET;
- clnt_sa.sin_port = clnt6_sa.sin6_port;
- clnt6_sa.sin6_family = AF_INET;
- }
-
- if (have_ipv6 &&
- ((struct sockaddr *) &clnt6_sa)->sa_family == AF_INET6) {
- if ( ! is_loopback_addr ((gchar *) &clnt6_sa.sin6_addr, AF_INET6)) {
- clnt6_sa.sin6_scope_id = 0;
-
- getnameinfo ((struct sockaddr *)&clnt6_sa, sizeof (struct sockaddr_in6), hbuf, sizeof (hbuf), NULL, 0, 0);
-
- hostname = hbuf;
-
- if (strlen (hostname) + 1 > pipe_buf)
- goto done;
- hostname = g_strdup (hostname);
-
- } else {
- hostname = g_new0 (char, 1024);
-
- if (gethostname (hostname, 1023) != 0) {
- g_free (hostname);
- goto done;
- }
- added6_addr = NULL;
- gh = gdm_host_known ((char *)&clnt6_sa.sin6_addr, AF_INET6);
- }
- } else
-#endif
- {
- if ( !is_loopback_addr ((char *)&clnt_sa.sin_addr, AF_INET)) {
- he = gethostbyaddr ((gchar *) &clnt_sa.sin_addr,
- sizeof (struct in_addr),
- AF_INET);
-
- hostname = (he && he->h_name) ? he->h_name : inet_ntoa (clnt_sa.sin_addr);
- if (strlen (hostname) + 1 > pipe_buf)
- goto done;
-
- hostname = g_strdup (hostname);
- } else {
- hostname = g_new0 (char, 1024);
- if (gethostname (hostname, 1023) != 0) {
- g_free (hostname);
- goto done;
- }
- }
- }
-
- /* We can't pipe hostnames larger than this */
- if (pipe_buf > 0 && strlen (hostname)+1 > pipe_buf) {
- g_free (hostname);
- goto done;
- }
-
-#ifdef ENABLE_IPV6
- if (have_ipv6 && ((struct sockaddr *) &clnt6_sa)->sa_family == AF_INET6) {
- gh = gdm_host_known ((char *)&clnt6_sa.sin6_addr, AF_INET6);
- if (gh == NULL) {
- gh = gdm_chooser_host_alloc (hostname, status, (char *)&clnt6_sa.sin6_addr, AF_INET6, header.opcode == WILLING);
- gdm_chooser_browser_add_host (gh);
- }
- } else
-#endif
- {
- gh = gdm_host_known ((char *)&clnt_sa.sin_addr, AF_INET);
- if (gh == NULL) {
- gh = gdm_chooser_host_alloc (hostname, status, (char *)&clnt_sa.sin_addr, AF_INET, header.opcode == WILLING);
- gdm_chooser_browser_add_host (gh);
- }
- }
- if (gh != NULL) {
- /* server changed it's mind */
- if (header.opcode == WILLING &&
- ! gh->willing) {
- gh->willing = TRUE;
- gdm_chooser_browser_add_host (gh);
- }
- /* hmmm what about the other change, just ignore
- for now, it's kind of confusing to just remove
- servers really */
- }
-#ifdef ENABLE_IPV6
- if (have_ipv6 &&
- ((struct sockaddr *) &clnt6_sa)->sa_family == AF_INET6 &&
- ! gh->willing &&
- added6_addr != NULL &&
- memcmp (&gh->ia6, added6_addr, sizeof (struct in6_addr)) == 0) {
-
- added6_addr = NULL;
- host_not_willing = TRUE;
- }
- else
-#endif
- if (clnt_sa.sin_family == AF_INET &&
- ! gh->willing &&
- added_addr != NULL &&
- memcmp (&gh->ia, added_addr, sizeof (struct in_addr)) == 0) {
-
- added_addr = NULL;
- host_not_willing = TRUE;
- }
-
- if (host_not_willing) {
- GtkWidget *dialog;
- gchar *msg;
-
- if (add_check_handler > 0)
- g_source_remove (add_check_handler);
- add_check_handler = 0;
-
- msg = g_strdup_printf (_("The host \"%s\" is not willing "
- "to support a login session right now. "
- "Please try again later."),
- added_host);
-
- dialog = ve_hig_dialog_new
- (GTK_WINDOW (chooser) /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot connect to remote server"),
- msg);
-
- g_free (msg);
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
-
- g_free (added_host);
- added_host = NULL;
- }
-
- g_free (hostname);
-
- done:
- if (header.opcode == WILLING) {
- XdmcpDisposeARRAY8 (&auth);
- XdmcpDisposeARRAY8 (&host);
- XdmcpDisposeARRAY8 (&stat);
- }
-
- g_free (status);
-
- return TRUE;
-}
-
-
-/* Find broadcast address for all active, non pointopoint interfaces */
-static void
-gdm_chooser_find_bcaddr (void)
-{
- int i = 0, num;
- int sock;
- struct ifconf ifc;
- char *buf;
- struct ifreq *ifr;
-
- sock = socket (AF_INET, SOCK_DGRAM, 0);
-#ifdef SIOCGIFNUM
- if (ioctl (sock, SIOCGIFNUM, &num) < 0) {
- num = 64;
- }
-#else
- num = 64;
-#endif
-
- ifc.ifc_len = sizeof (struct ifreq) * num;
- ifc.ifc_buf = buf = g_malloc0 (ifc.ifc_len);
- if (ioctl (sock, SIOCGIFCONF, &ifc) < 0) {
- g_free (buf);
- gdm_common_error ("Could not get local addresses!");
- close (sock);
- return;
- }
-
- ifr = ifc.ifc_req;
- num = ifc.ifc_len / sizeof (struct ifreq);
- for (i = 0 ; i < num ; i++) {
- if ( ! ve_string_empty (ifr[i].ifr_name)) {
- struct ifreq ifreq;
- struct sockaddr_in *ba = NULL;
- struct sockaddr_in *sin = NULL;
-
- memset (&ifreq, 0, sizeof (ifreq));
-
- strncpy (ifreq.ifr_name, ifr[i].ifr_name,
- sizeof (ifreq.ifr_name));
- /* paranoia */
- ifreq.ifr_name[sizeof (ifreq.ifr_name) - 1] = '\0';
-
- if (ioctl (sock, SIOCGIFFLAGS, &ifreq) < 0)
- gdm_common_error ("Could not get SIOCGIFFLAGS for %s", ifr[i].ifr_name);
-
- if ((ifreq.ifr_flags & IFF_UP) == 0 ||
- (ifreq.ifr_flags & IFF_BROADCAST) == 0 ||
- ioctl (sock, SIOCGIFBRDADDR, &ifreq) < 0)
- continue;
-
- ba = (struct sockaddr_in *) &ifreq.ifr_broadaddr;
-
- sin = g_new0 (struct sockaddr_in, 1);
-
- sin->sin_family = AF_INET;
- memcpy (&sin->sin_addr, &ba->sin_addr, sizeof (ba->sin_addr));
- bcaddr = g_slist_append (bcaddr, sin);
- }
- }
-
- g_free (buf);
-}
-
-/* Append multicast address into the list */
-#ifdef ENABLE_IPV6
-static void
-gdm_chooser_find_mcaddr (void)
-{
- struct sockaddr_in6 *sin6;
- int sock; /* Temporary socket for getting information about available interfaces */
- u_char loop = 0; /* Disable multicast for loopback interface */
- int i, num;
- char *buf;
- /* For interfaces' list */
- struct ifconf ifc;
- struct ifreq *ifr = NULL;
-
- sock = socket (AF_INET, SOCK_DGRAM, 0);
-#ifdef SIOCGIFNUM
- if (ioctl (sock, SIOCGIFNUM, &num) < 0) {
- num = 64;
- }
-#else
- num = 64;
-#endif
- ifc.ifc_len = sizeof (struct ifreq) * num;
- ifc.ifc_buf = buf = malloc (ifc.ifc_len);
-
- if (setsockopt (sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &loop, sizeof (loop)) < 0)
- gdm_common_error ("setsockopt: Could not disable loopback interface for multicasting\n");
-
- if (ioctl (sock, SIOCGIFCONF, &ifc) >= 0)
- ifr = ifc.ifc_req;
- num = ifc.ifc_len / sizeof (struct ifreq); /* No of interfaces */
- for (i = 0 ; i < num ; i++) {
- struct ifreq ifreq;
- int ifindex;
-
- memset (&ifreq, 0, sizeof (ifreq));
- strncpy (ifreq.ifr_name, ifr[i].ifr_name, sizeof (ifreq.ifr_name));
- ifreq.ifr_name[sizeof (ifreq.ifr_name) - 1] = '\0';
-
- if (ioctl (sock, SIOCGIFFLAGS, &ifreq) < 0)
- gdm_common_error ("Could not get interface flags for %s\n", ifr[i].ifr_name);
- ifindex = if_nametoindex (ifr[i].ifr_name);
-
- if ((!(ifreq.ifr_flags & IFF_UP) || (!(ifreq.ifr_flags & IFF_MULTICAST))) || (ifindex == 0 )) {
- /* Not a valid interface or Not up */
- continue;
- }
-
- sin6 = g_new0 (struct sockaddr_in6, 1);
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = htons (XDM_UDP_PORT);
- sin6->sin6_scope_id = ifindex;
- inet_pton (AF_INET6, gdm_config_get_string (GDM_KEY_MULTICAST_ADDR),
- &sin6->sin6_addr);
-
- /* bcaddr is also serving for multicast address for IPv6 */
- bcaddr = g_slist_append (bcaddr, sin6);
- }
-}
-#endif
-
-static gboolean
-chooser_scan_time_update (gpointer data)
-{
- GList *li;
- scan_time_handler = 0;
- for (li = chooser_hosts; li != NULL; li = li->next) {
- GdmChooserHost *host = (GdmChooserHost *) li->data;
- if (host->willing)
- break;
- }
- if (li != NULL /* something was found */) {
- gtk_label_set_label (GTK_LABEL (status_label), _(active_network));
- } else {
- gtk_label_set_label (GTK_LABEL (status_label), _(empty_network));
- }
- gtk_widget_set_sensitive (GTK_WIDGET (rescan), TRUE);
- return FALSE;
-}
-
-static void
-do_ping (gboolean full)
-{
- struct sockaddr_in sock;
- GSList *bl = bcaddr;
- GSList *ql = queryaddr;
- struct sockaddr *ia;
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 sock6;
-
- memset (&sock6, 0, sizeof (sock6));
- sock6.sin6_family = AF_INET6;
- sock6.sin6_port = htons (XDM_UDP_PORT);
-#endif
-
- sock.sin_family = AF_INET;
- sock.sin_port = htons (XDM_UDP_PORT);
-
- while (bl) {
- ia = (struct sockaddr *) bl->data;
-#ifdef ENABLE_IPV6
- if (have_ipv6) { /* Convert the IPv4 broadcast address to v4 mapped v6 address.*/
- if (ia->sa_family == AF_INET) {
- char tmpaddr[30];
- struct in6_addr in6;
-
- sprintf (tmpaddr, "::ffff:%s", inet_ntoa (((struct sockaddr_in *)(ia))->sin_addr));
- inet_pton (AF_INET6, tmpaddr, &in6);
- memcpy (sock6.sin6_addr.s6_addr, in6.s6_addr, sizeof (struct in6_addr));
- XdmcpFlush (sockfd, &bcbuf, (XdmcpNetaddr) &sock6, (int) sizeof (struct sockaddr_in6));
- }
-
- else if (ia->sa_family == AF_INET6) {
- memcpy (sock6.sin6_addr.s6_addr, ((struct sockaddr_in6 *)ia)->sin6_addr.s6_addr, sizeof (struct in6_addr));
- XdmcpFlush (sockfd, &bcbuf, (XdmcpNetaddr) &sock6, (int) sizeof (struct sockaddr_in6));
- }
- }
- else
-#endif
- {
- if (ia->sa_family == AF_INET) {
- sock.sin_addr.s_addr = ((struct sockaddr_in *)ia)->sin_addr.s_addr;
- XdmcpFlush (sockfd, &bcbuf, (XdmcpNetaddr) &sock, (int)sizeof (struct sockaddr_in));
- }
- }
- bl = bl->next;
- }
-
- while (ql != NULL) {
- ia = (struct sockaddr *) ql->data;
-
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- if (ia->sa_family == AF_INET) {
- char tmpaddr[30];
- struct in6_addr in6;
-
- sprintf (tmpaddr, "::ffff:%s", inet_ntoa (((struct sockaddr_in *)(ia))->sin_addr));
- inet_pton (AF_INET6, tmpaddr, &in6);
-
- if (full || ! gdm_host_known ((char *)&((struct sockaddr_in6 *)ia)->sin6_addr, AF_INET6)) {
- memcpy (sock6.sin6_addr.s6_addr, in6.s6_addr, sizeof (struct in6_addr));
- XdmcpFlush (sockfd, &bcbuf, (XdmcpNetaddr) &sock6, (int) sizeof (struct sockaddr_in6));
- }
- }
-
- if (ia->sa_family == AF_INET6) {
- if (full || ! gdm_host_known ((char *)&((struct sockaddr_in6 *)ia)->sin6_addr, AF_INET6)) {
- memcpy (&sock6.sin6_addr, &((struct sockaddr_in6 *)ia)->sin6_addr, sizeof (struct in6_addr));
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock6, (int) sizeof (struct sockaddr_in6));
- }
- }
- }
- else
-#endif
- {
- if (full || ! gdm_host_known ((char *)&((struct sockaddr_in *)ia)->sin_addr, AF_INET)) {
- sock.sin_addr.s_addr = ((struct sockaddr_in *)ia)->sin_addr.s_addr;
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock, (int)sizeof (struct sockaddr_in));
- }
- }
- ql = ql->next;
- }
-}
-
-static gboolean
-ping_try (gpointer data)
-{
- do_ping (FALSE);
-
- ping_tries --;
- if (ping_tries <= 0)
- return FALSE;
- else
- return TRUE;
-}
-
-void
-gdm_chooser_xdmcp_discover (void)
-{
- GList *hl = chooser_hosts;
-
- g_free (added_host);
- added_host = NULL;
-#ifdef ENABLE_IPV6
- added6_addr = NULL;
-#endif
- added_addr = NULL;
- if (add_check_handler > 0)
- g_source_remove (add_check_handler);
- add_check_handler = 0;
-
- gtk_widget_set_sensitive (GTK_WIDGET (manage), FALSE);
- gtk_widget_set_sensitive (GTK_WIDGET (rescan), FALSE);
- gtk_list_store_clear (GTK_LIST_STORE (browser_model));
- gtk_widget_set_sensitive (GTK_WIDGET (browser), FALSE);
- gtk_label_set_label (GTK_LABEL (status_label),
- _(scanning_message));
-
- while (hl) {
- gdm_chooser_host_dispose ((GdmChooserHost *) hl->data);
- hl = hl->next;
- }
-
- g_list_free (chooser_hosts);
- chooser_hosts = NULL;
-
- do_ping (TRUE);
-
- if (scan_time_handler > 0)
- g_source_remove (scan_time_handler);
- scan_time_handler = g_timeout_add (gdm_config_get_int (GDM_KEY_SCAN_TIME) * 1000,
- chooser_scan_time_update, NULL);
-
- /* Note we already used up one try */
- ping_tries = PING_TRIES - 1;
- if (ping_try_handler > 0)
- g_source_remove (ping_try_handler);
- ping_try_handler = g_timeout_add (PING_TIMEOUT, ping_try, NULL);
-}
-
-#ifndef ishexdigit
-#define ishexdigit(c) (isdigit(c) || ('a' <= (c) && (c) <= 'f'))
-#endif
-#define HexChar(c) ('0' <= (c) && (c) <= '9' ? (c) - '0' : (c) - 'a' + 10)
-
-static int
-from_hex (const char *s, char *d, int len)
-{
- int t;
- while (len >= 2)
- {
- if (!ishexdigit(*s))
- return 1;
- t = HexChar(*s) << 4;
- s++;
- if (!ishexdigit(*s))
- return 1;
- t += HexChar(*s);
- s++;
- *d++ = t;
- len -= 2;
- }
- return len;
-}
-
-static void
-gdm_chooser_add_hosts (char **hosts)
-{
- struct hostent *hostent;
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 *qa6 = NULL;
- struct addrinfo hints, *result, *res;
-#endif
- struct sockaddr_in* qa = NULL;
- int used_addr = 0;
- int i;
-
- for (i = 0; hosts != NULL && hosts[i] != NULL; i++) {
- const char *name = hosts[i];
-
- if (strcmp (name, "BROADCAST") == 0) {
- gdm_chooser_find_bcaddr ();
- continue;
- }
-#ifdef ENABLE_IPV6
- if (strcmp (name, "MULTICAST") == 0) {
- gdm_chooser_find_mcaddr ();
- continue;
- }
-#endif
- if (used_addr == AF_INET || !qa) {
- qa = g_new0 (struct sockaddr_in, 1);
- memset (qa, 0, sizeof (*qa));
- qa->sin_family = AF_INET;
- }
-#ifdef ENABLE_IPV6
- if (used_addr == AF_INET6 || !qa6) {
- qa6 = g_new0 (struct sockaddr_in6, 1);
- memset (qa6, 0, sizeof (qa6));
- qa6->sin6_family = AF_INET6;
- }
-
- result = NULL;
- memset (&hints, 0, sizeof (hints));
- hints.ai_socktype = SOCK_STREAM;
-
- if ((strlen (name) == 32) && from_hex (name, (char *) &qa6->sin6_addr, strlen (name)) == 0) {
- queryaddr = g_slist_append (queryaddr, qa6);
- g_free (qa);
- qa = NULL;
- used_addr = AF_INET6;
- }
- else
-#endif
- if ((strlen (name) == 8) && (from_hex (name, (char *) &qa->sin_addr, strlen (name)) == 0)) {
- queryaddr = g_slist_append (queryaddr, qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
- qa6 = NULL;
-#endif
- used_addr = AF_INET;
- }
- else
-#ifdef ENABLE_IPV6
- if (inet_pton (AF_INET6, name, &qa6->sin6_addr) > 0) {
- queryaddr = g_slist_append (queryaddr, qa6);
- g_free (qa);
- qa = NULL;
- used_addr = AF_INET6;
- }
- else
-#endif
- if ((qa->sin_addr.s_addr = inet_addr (name)) != -1) {
- queryaddr = g_slist_append (queryaddr, qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
- qa6 = NULL;
-#endif
- used_addr = AF_INET;
- }
- else
-#ifdef ENABLE_IPV6
- if (getaddrinfo (name, NULL, &hints, &result) == 0) {
- for (res = result; res; res = res->ai_next) {
- if (res && res->ai_family == AF_INET6) {
- memmove (qa6, res->ai_addr, res->ai_addrlen);
- queryaddr = g_slist_append (queryaddr, qa6);
- g_free (qa);
- qa = NULL;
- used_addr = AF_INET6;
- }
- if (res && res->ai_family == AF_INET) {
- memmove (qa, res->ai_addr, res->ai_addrlen);
- queryaddr = g_slist_append (queryaddr, qa);
- g_free (qa6);
- qa6 = NULL;
- used_addr = AF_INET;
- }
- }
- } else
-#endif
- if ((hostent = gethostbyname (name)) != NULL
- && hostent->h_addrtype == AF_INET
- && hostent->h_length == 4) {
- qa->sin_family = AF_INET;
- memmove (&qa->sin_addr, hostent->h_addr, 4);
- queryaddr = g_slist_append (queryaddr, qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
- qa6 = NULL;
-#endif
- used_addr = AF_INET;
- } else {
- continue; /* not a valid address */
- }
- }
-
- if (bcaddr == NULL &&
- queryaddr == NULL)
- gdm_chooser_find_bcaddr ();
-}
-
-static void
-gdm_chooser_xdmcp_init (char **hosts)
-{
- static XdmcpHeader header;
- gint sockopts = 1;
-
- /* Open socket for communication */
-#ifdef ENABLE_IPV6
- if ((sockfd = socket (AF_INET6, SOCK_DGRAM, 0)) == -1)
- have_ipv6 = FALSE;
- else
- have_ipv6 = TRUE;
-#endif
- if ( ! have_ipv6) {
- if ((sockfd = socket (AF_INET, SOCK_DGRAM, 0)) == -1) {
- gdm_common_fail_exit ("Could not create socket!");
- }
- }
-
- if (setsockopt (sockfd, SOL_SOCKET, SO_BROADCAST,
- (char *) &sockopts, sizeof (sockopts)) < 0) {
- gdm_common_fail_exit ("Could not set socket options!");
- }
-
- /* Assemble XDMCP BROADCAST_QUERY packet in static buffer */
- header.opcode = (CARD16) BROADCAST_QUERY;
- header.length = 1;
- header.version = XDM_PROTOCOL_VERSION;
- XdmcpWriteHeader (&bcbuf, &header);
- XdmcpWriteARRAY8 (&bcbuf, &authlist.authentication);
-
- /* Assemble XDMCP QUERY packet in static buffer */
- header.opcode = (CARD16) QUERY;
- header.length = 1;
- header.version = XDM_PROTOCOL_VERSION;
- XdmcpWriteHeader (&querybuf, &header);
- XdmcpWriteARRAY8 (&querybuf, &authlist.authentication);
-
- gdm_chooser_add_hosts (hosts);
-
- channel = g_io_channel_unix_new (sockfd);
- g_io_channel_set_encoding (channel, NULL, NULL);
- g_io_channel_set_buffered (channel, FALSE);
- g_io_add_watch_full (channel, G_PRIORITY_DEFAULT,
- G_IO_IN|G_IO_PRI|G_IO_ERR|G_IO_HUP|G_IO_NVAL,
- gdm_chooser_decode_packet,
- GINT_TO_POINTER (sockfd), NULL);
- g_io_channel_unref (channel);
-
- gdm_chooser_xdmcp_discover ();
-}
-
-static void
-gdm_chooser_choose_host (const char *hostname)
-{
- ARRAY8 tmparr;
-#ifndef ENABLE_IPV6
- struct hostent *hentry;
-#endif
-
- printf ("\n%s\n", curhost->name);
- fflush (stdout);
- if (xdm_address != NULL) {
-#ifdef ENABLE_IPV6
- int status;
- struct sockaddr_in6 in6_addr;
- struct addrinfo hints, *result;
-#endif
- struct sockaddr_in in_addr;
- char xdm_addr[32];
- char client_addr[32];
- int fd;
- char buf[1024];
- XdmcpBuffer buffer;
- long family, port, addr;
-
- if (strlen (xdm_address) > 64 ||
- from_hex (xdm_address, xdm_addr, strlen (xdm_address)) != 0) {
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Invalid xdm address.");
- }
-
- family = (xdm_addr[0] << 8) | xdm_addr[1];
- port = (xdm_addr[2] << 8) | xdm_addr[3];
-
-#ifdef ENABLE_IPV6
- if (family == AF_INET6) {
- memset (&in6_addr, 0, sizeof (in6_addr));
-
- in6_addr.sin6_port = htons (port);
- in6_addr.sin6_family = AF_INET6;
-
- memcpy (&in6_addr.sin6_addr, &xdm_address[4], 16);
-
- if ((fd = socket (PF_INET6, SOCK_STREAM, 0)) == -1) {
- gdm_common_fail_exit ("gdm_chooser_choose_host: Could not create response socket.");
- }
-
- if (connect (fd, (struct sockaddr *) &in6_addr,
- sizeof (in6_addr)) == -1) {
-
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Could not connect to xdm.");
- }
- } else
-#endif
- {
- addr = (xdm_addr[4] << 24) | (xdm_addr[5] << 16) |
- (xdm_addr[6] << 8) | xdm_addr[7];
-
- in_addr.sin_family = AF_INET;
- in_addr.sin_port = htons (port);
- in_addr.sin_addr.s_addr = htonl (addr);
-
- if ((fd = socket (PF_INET, SOCK_STREAM, 0)) == -1) {
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Could not create response socket.");
- }
-
- if (connect (fd, (struct sockaddr *) &in_addr,
- sizeof (in_addr)) == -1) {
-
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Could not connect to xdm.");
- }
- }
-
- buffer.data = (BYTE *) buf;
- buffer.size = sizeof (buf);
- buffer.pointer = 0;
- buffer.count = 0;
-
- if (strlen (client_address) > 64 || from_hex (client_address,
- client_addr, strlen (client_address)) != 0) {
-
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Invalid client address.");
- }
-
- tmparr.data = (BYTE *) client_addr;
- tmparr.length = strlen (client_address) / 2;
-
- XdmcpWriteARRAY8 (&buffer, &tmparr);
- XdmcpWriteCARD16 (&buffer, (CARD16) connection_type);
-
-#ifdef ENABLE_IPV6
- result = NULL;
- memset (&hints, 0, sizeof (hints));
- hints.ai_socktype = SOCK_STREAM;
-
- status = getaddrinfo (hostname, NULL, &hints, &result);
-
- if (status != 0) {
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Could not get host entry for %s",
- hostname);
- }
-
- if (result->ai_family == AF_INET6)
- tmparr.length = 16;
- if (result->ai_family == AF_INET)
- tmparr.length = 4;
- tmparr.data = (BYTE *) result->ai_addr;
-#else
- hentry = gethostbyname (hostname);
-
- if (!hentry) {
- gdm_common_fail_exit ("gdm_chooser_chooser_host: Could not get host entry for %s",
- hostname);
- }
-
- tmparr.data = (BYTE *) hentry->h_addr_list[0]; /* XXX */
- tmparr.length = 4;
-
-#endif
- XdmcpWriteARRAY8 (&buffer, &tmparr);
- write (fd, (char *) buffer.data, buffer.pointer);
- close (fd);
- }
-}
-
-static gboolean
-add_check (gpointer data)
-{
- gboolean check = FALSE;
-
-#ifdef ENABLE_IPV6
- if (have_ipv6 && added6_addr != NULL)
- check = TRUE;
- else
-#endif
- if ((! have_ipv6) && added_addr != NULL)
- check = TRUE;
-
- if (check) {
- GtkWidget *dialog;
- gchar *msg;
-
- msg = g_strdup_printf (_("Did not receive any response from host \"%s\" "
- "in %d seconds. Perhaps the host is not "
- "turned on, or is not willing to support a "
- "login session right now. Please try again "
- "later."),
- added_host,
- ADD_TIMEOUT / 1000);
-
- dialog = ve_hig_dialog_new
- (GTK_WINDOW (chooser) /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Did not receive response from server"),
- msg);
-
- g_free (msg);
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- }
- add_check_handler = 0;
- return FALSE;
-}
-
-void
-gdm_chooser_add_host (void)
-{
- struct hostent *hostent;
- struct sockaddr_in *qa;
- GdmChooserHost *host = NULL;
- struct sockaddr_in sock;
- gboolean status = FALSE;
- const char *name;
-#ifdef ENABLE_IPV6
- struct sockaddr_in6 *qa6;
- struct sockaddr_in6 sock6;
- struct addrinfo hints, *result;
-
- result = NULL;
- memset (&hints, 0, sizeof (hints));
- hints.ai_socktype = SOCK_DGRAM;
-#endif
-
- name = gtk_entry_get_text (GTK_ENTRY (add_entry));
- if (ve_string_empty (name))
- return;
-
- qa = g_new0 (struct sockaddr_in, 1);
- qa->sin_family = AF_INET;
-#ifdef ENABLE_IPV6
- qa6 = g_new0 (struct sockaddr_in6, 1);
- qa6->sin6_family = AF_INET6;
-
- if (have_ipv6 && strlen (name) == 32 &&
- from_hex (name, (char *) &qa6->sin6_addr, strlen (name)) == 0) ;
-
- else
-#endif
- if (strlen (name) == 8 &&
- from_hex (name, (char *) &qa->sin_addr, strlen (name)) == 0) {
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- char tmpaddr[30];
-
- sprintf (tmpaddr, "::ffff:%s", inet_ntoa (qa->sin_addr));
- inet_pton (AF_INET6, tmpaddr, &qa6->sin6_addr);
- }
-#endif
- }
- else
-#ifdef ENABLE_IPV6
- if (have_ipv6 && inet_pton (AF_INET6, name, &qa6->sin6_addr) > 0) ;
- else
-#endif
- if (inet_aton (name, &(qa->sin_addr))) {
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- char tmpaddr[30];
-
- sprintf (tmpaddr, "::ffff:%s", inet_ntoa (qa->sin_addr));
- inet_pton (AF_INET6, tmpaddr, &qa6->sin6_addr);
- }
-#endif
- }
- else
-#ifdef ENABLE_IPV6
- if (getaddrinfo (name, NULL, &hints, &result) == 0) {
- if (result->ai_family == AF_INET6) {
- memcpy (qa6, (struct sockaddr_in6 *)result->ai_addr, result->ai_addrlen);
- }
- else if (result->ai_family == AF_INET) {
- if (have_ipv6) {
- char tmpaddr [30];
-
- sprintf (tmpaddr, "::ffff:%s",
- inet_ntoa (((struct sockaddr_in *)result->ai_addr)->sin_addr));
- inet_pton (AF_INET6, tmpaddr, &qa6->sin6_addr);
- }
- }
- }
- else
-#endif
- if ((hostent = gethostbyname (name)) != NULL &&
- hostent->h_addrtype == AF_INET && hostent->h_length == 4) {
- memmove (&qa->sin_addr, hostent->h_addr, 4);
- } else {
- GtkWidget *dialog;
- gchar *msg;
-
- msg = g_strdup_printf (_("Cannot find the host \"%s\". "
- "Perhaps you have mistyped it."),
- name);
-
- dialog = ve_hig_dialog_new
- (GTK_WINDOW (chooser) /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot find host"),
- msg);
-
- g_free (msg);
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- g_free (qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
-#endif
- return; /* not a valid address */
- }
-
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- memset (&sock6, 0, sizeof (struct sockaddr_in6));
- sock6.sin6_family = AF_INET6;
- sock6.sin6_port = htons (XDM_UDP_PORT);
- status = gdm_addr_known ((char *)&qa6->sin6_addr, AF_INET6);
- if ( ! status) {
- queryaddr = g_slist_append (queryaddr, qa6);
- }
- if (IN6_IS_ADDR_V4MAPPED (&qa6->sin6_addr)) {
- memcpy (&qa->sin_addr, &(qa6->sin6_addr.s6_addr[12]), 4);
- host = gdm_host_known ((char *) &qa->sin_addr, AF_INET);
- }
- else
- host = gdm_host_known ((char *) &qa6->sin6_addr, AF_INET6);
- } else
-#endif
- {
- memset (&sock, 0, sizeof (struct sockaddr_in));
- sock.sin_family = AF_INET;
- sock.sin_port = htons (XDM_UDP_PORT);
- status = gdm_addr_known ((char *)&qa->sin_addr, AF_INET);
- if ( ! status) {
- queryaddr = g_slist_append (queryaddr, qa);
- }
- host = gdm_host_known ((char *) &qa->sin_addr, AF_INET);
- }
-
- if (host != NULL) {
- GtkTreeIter iter = {0};
- if (find_host_in_list (host, &iter)) {
- GtkTreeSelection *selection;
- GtkTreePath *path = gtk_tree_model_get_path (browser_model, &iter);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- gtk_widget_grab_focus (manage);
- } else {
- /* hmm, probably not willing, ping the host then for
- good measure */
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- memcpy (&sock6.sin6_addr, &qa6->sin6_addr, sizeof (qa6->sin6_addr));
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock6, (int) sizeof (struct sockaddr_in6));
- added6_addr = &qa6->sin6_addr;
- if (IN6_IS_ADDR_V4MAPPED (added6_addr))
- added_addr = (struct in_addr *)&(qa6->sin6_addr.s6_addr[12]);
- } else
-#endif
- {
- sock.sin_addr.s_addr = qa->sin_addr.s_addr;
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock, (int)sizeof (struct sockaddr_in));
- added_addr = &qa->sin_addr;
- }
- g_free (added_host);
- added_host = g_strdup (name);
-
- if (add_check_handler > 0)
- g_source_remove (add_check_handler);
- add_check_handler = g_timeout_add (ADD_TIMEOUT,
- add_check, NULL);
- }
-
- /* empty the text entry to indicate success */
- gtk_entry_set_text (GTK_ENTRY (add_entry), "");
- g_free (qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
-#endif
- return;
- }
-#ifdef ENABLE_IPV6
- if (have_ipv6) {
- added6_addr = &qa6->sin6_addr;
-
- if (IN6_IS_ADDR_V4MAPPED (added6_addr))
- added_addr = (struct in_addr *)&(qa6->sin6_addr.s6_addr[12]);
-
- memcpy (&sock6.sin6_addr, &qa6->sin6_addr, sizeof (struct in6_addr));
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock6, (int)sizeof (struct sockaddr_in6));
- } else
-#endif
- {
- added_addr = &qa->sin_addr;
-
- /* and send out the query */
- sock.sin_addr.s_addr = qa->sin_addr.s_addr;
- XdmcpFlush (sockfd, &querybuf, (XdmcpNetaddr) &sock, (int)sizeof (struct sockaddr_in));
- }
- g_free (added_host);
- added_host = g_strdup (name);
- if (add_check_handler > 0)
- g_source_remove (add_check_handler);
- add_check_handler = g_timeout_add (ADD_TIMEOUT,
- add_check, NULL);
-
- /* empty the text entry to indicate success */
- gtk_entry_set_text (GTK_ENTRY (add_entry), "");
-
- g_free (qa);
-#ifdef ENABLE_IPV6
- g_free (qa6);
-#endif
-}
-
-void
-gdm_chooser_add_entry_changed (void)
-{
- const char *name;
-
- name = gtk_entry_get_text (GTK_ENTRY (add_entry));
- gtk_widget_set_sensitive (add_button, ! ve_string_empty (name));
-}
-
-void
-gdm_chooser_cancel (int sig)
-{
- if (scan_time_handler > 0) {
- g_source_remove (scan_time_handler);
- scan_time_handler = 0;
- }
-
- closelog ();
- /* exit rather gtk_main_quit, it's just safer this way we don't
- have to worry about random whackiness happening */
- exit (EXIT_SUCCESS);
-}
-
-
-void
-gdm_chooser_manage (GtkButton *button, gpointer data)
-{
- if (scan_time_handler > 0) {
- g_source_remove (scan_time_handler);
- scan_time_handler = 0;
- }
-
- if (curhost)
- gdm_chooser_choose_host (curhost->name);
-
- closelog ();
-
- /* exit rather gtk_main_quit, it's just safer this way we don't
- have to worry about random whackiness happening */
- exit (EXIT_SUCCESS);
-}
-
-static void
-host_selected (GtkTreeSelection *selection, gpointer data)
-{
- GtkTreeModel *tm = NULL;
- GtkTreeIter iter = {0};
-
- curhost = NULL;
-
- if (gtk_tree_selection_get_selected (selection, &tm, &iter)) {
- gtk_tree_model_get (tm, &iter, CHOOSER_LIST_HOST_COLUMN,
- &curhost, -1);
- }
-
- gtk_widget_set_sensitive (manage, curhost != NULL);
-}
-
-static void
-row_activated (GtkTreeView *tree_view,
- GtkTreePath *path,
- GtkTreeViewColumn *column)
-{
- if (curhost != NULL)
- gdm_chooser_manage (NULL, NULL);
-}
-
-void
-display_chooser_information (void)
-{
- GtkWidget *dialog;
-
- /* How to get HIG compliance? */
- dialog = gtk_message_dialog_new
- (GTK_WINDOW (chooser) /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- _("The main area of this application shows the hosts on "
- "the local network that have \"XDMCP\" enabled. This "
- "allows users to login remotely to other computers as "
- "if they were logged on using the console.\n\n"
- "You can rescan the network for new hosts by clicking "
- "\"Refresh\". When you have selected a host click "
- "\"Connect\" to open a session to that computer."));
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
-}
-
-static void
-gdm_chooser_gui_init (void)
-{
- GtkTreeSelection *selection;
- GtkTreeViewColumn *column;
- gchar *defaulthosticon;
- int width;
- int height;
-
- glade_helper_add_glade_directory (GDM_GLADE_DIR);
- glade_helper_search_gnome_dirs (FALSE);
-
- /* Enable theme */
- if (RUNNING_UNDER_GDM) {
- const char *theme_name;
-
- if ( ! ve_string_empty (gdm_config_get_string (GDM_KEY_GTKRC)))
- gtk_rc_parse (gdm_config_get_string (GDM_KEY_GTKRC));
-
- theme_name = g_getenv ("GDM_GTK_THEME");
- if (ve_string_empty (theme_name))
- theme_name = gdm_config_get_string (GDM_KEY_GTK_THEME);
-
- if ( ! ve_string_empty (theme_name)) {
- gdm_set_theme (theme_name);
- }
- }
-
- defaulthosticon = gdm_config_get_string (GDM_KEY_DEFAULT_HOST_IMG);
-
- /* Load default host image */
- if (g_access (defaulthosticon, R_OK) != 0) {
- gdm_common_error ("Could not open default host icon: %s", defaulthosticon);
- /* bogus image */
- defhostimg = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- FALSE /* has_alpha */,
- 8 /* bits_per_sample */,
- 48 /* width */,
- 48 /* height */);
- } else {
- defhostimg = gdk_pixbuf_new_from_file (defaulthosticon, NULL);
- }
-
- /* Main window */
- chooser_app = glade_helper_load ("gdmchooser.glade",
- "gdmchooser_main",
- GTK_TYPE_DIALOG,
- FALSE /* dump_on_destroy */);
- glade_xml_signal_autoconnect (chooser_app);
-
- chooser = glade_helper_get (chooser_app, "gdmchooser_main",
- GTK_TYPE_DIALOG);
- manage = glade_helper_get (chooser_app, "connect_button",
- GTK_TYPE_BUTTON);
- rescan = glade_helper_get (chooser_app, "rescan_button",
- GTK_TYPE_BUTTON);
- cancel = glade_helper_get (chooser_app, "quit_button",
- GTK_TYPE_BUTTON);
- status_label = glade_helper_get (chooser_app, "status_label",
- GTK_TYPE_LABEL);
- add_entry = glade_helper_get (chooser_app, "add_entry",
- GTK_TYPE_ENTRY);
- add_button = glade_helper_get (chooser_app, "add_button",
- GTK_TYPE_BUTTON);
-
- browser = glade_helper_get (chooser_app, "chooser_iconlist",
- GTK_TYPE_TREE_VIEW);
-
- gtk_dialog_set_has_separator (GTK_DIALOG (chooser), FALSE);
-
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), TRUE);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- g_signal_connect (selection, "changed",
- G_CALLBACK (host_selected),
- NULL);
- g_signal_connect (browser, "row_activated",
- G_CALLBACK (row_activated),
- NULL);
-
- browser_model = (GtkTreeModel *)gtk_list_store_new (3,
- GDK_TYPE_PIXBUF,
- G_TYPE_STRING,
- G_TYPE_POINTER);
- gtk_tree_view_set_model (GTK_TREE_VIEW (browser), browser_model);
- column = gtk_tree_view_column_new_with_attributes
- ("Icon",
- gtk_cell_renderer_pixbuf_new (),
- "pixbuf", CHOOSER_LIST_ICON_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column);
-
- column = gtk_tree_view_column_new_with_attributes
- ("Hostname",
- gtk_cell_renderer_text_new (),
- "markup", CHOOSER_LIST_LABEL_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column);
-
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (browser_model),
- CHOOSER_LIST_LABEL_COLUMN,
- GTK_SORT_ASCENDING);
-
-
- if ( ! gdm_config_get_bool (GDM_KEY_ALLOW_ADD)) {
- GtkWidget *w = glade_helper_get (chooser_app, "add_hbox",
- GTK_TYPE_HBOX);
- gtk_widget_hide (w);
- }
-
- gtk_window_get_size (GTK_WINDOW (chooser),
- &width, &height);
- if (RUNNING_UNDER_GDM) {
- if (width > gdm_wm_screen.width)
- width = gdm_wm_screen.width;
- if (height > gdm_wm_screen.height)
- height = gdm_wm_screen.height;
- } else {
- if (width > gdk_screen_width ())
- width = gdk_screen_width ();
- if (height > gdk_screen_height ())
- height = gdk_screen_height ();
- }
- gtk_widget_set_size_request (GTK_WIDGET (chooser),
- width, height);
- gtk_window_set_default_size (GTK_WINDOW (chooser),
- width, height);
- gtk_window_resize (GTK_WINDOW (chooser),
- width, height);
-
-
- /* cursor blinking is evil on remote displays, don't do it forever */
- gdm_common_setup_blinking ();
- gdm_common_setup_blinking_entry (add_entry);
-
- if (RUNNING_UNDER_GDM) {
- gtk_widget_show_now (chooser);
- gdm_wm_center_window (GTK_WINDOW (chooser));
- }
-}
-
-/*
- * If new configuration keys are added to this program, make sure to add the
- * key to the gdm_read_config and gdm_reread_config functions.
- */
-static gboolean
-gdm_read_config (void)
-{
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /*
- * Read all the keys at once and close sockets connection so we do
- * not have to keep the socket open.
- */
- gdm_config_get_string (GDM_KEY_HOSTS);
- gdm_config_get_string (GDM_KEY_GTKRC);
- gdm_config_get_string (GDM_KEY_GTK_THEME);
- gdm_config_get_string (GDM_KEY_DEFAULT_HOST_IMG);
- gdm_config_get_string (GDM_KEY_HOST_IMAGE_DIR);
- gdm_config_get_string (GDM_KEY_MULTICAST_ADDR);
- gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
- gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN);
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- gdm_config_get_int (GDM_KEY_SCAN_TIME);
- gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE);
- gdm_config_get_bool (GDM_KEY_ALLOW_ADD);
- gdm_config_get_bool (GDM_KEY_BROADCAST);
- gdm_config_get_bool (GDM_KEY_MULTICAST);
-
- gdmcomm_comm_bulk_stop ();
-
- return FALSE;
-}
-
-static gboolean
-gdm_reread_config (int sig, gpointer data)
-{
- /* reparse config stuff here. At least ones we care about */
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- if (gdm_config_reload_bool (GDM_KEY_DEBUG))
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /* FIXME: The following is evil, we should update on the fly rather
- * then just restarting */
- /* Also we may not need to check ALL those keys but just a few */
- if (gdm_config_reload_string (GDM_KEY_HOSTS) ||
- gdm_config_reload_string (GDM_KEY_GTKRC) ||
- gdm_config_reload_string (GDM_KEY_GTK_THEME) ||
- gdm_config_reload_string (GDM_KEY_DEFAULT_HOST_IMG) ||
- gdm_config_reload_string (GDM_KEY_HOST_IMAGE_DIR) ||
- gdm_config_reload_string (GDM_KEY_MULTICAST_ADDR) ||
- gdm_config_reload_int (GDM_KEY_XINERAMA_SCREEN) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_WIDTH) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_HEIGHT) ||
- gdm_config_reload_int (GDM_KEY_SCAN_TIME) ||
- gdm_config_reload_bool (GDM_KEY_ALLOW_ADD) ||
- gdm_config_reload_bool (GDM_KEY_BROADCAST) ||
- gdm_config_reload_bool (GDM_KEY_MULTICAST)) {
-
- if (RUNNING_UNDER_GDM) {
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
- gdm_wm_save_wm_order ();
- }
-
- /* we don't need to tell the slave that we're restarting
- it doesn't care about our state. Unlike with the greeter */
- execvp (stored_argv[0], stored_argv);
- _exit (DISPLAY_REMANAGE);
- }
-
- /* we only use the color and do it for all types except NONE */
- if (gdm_config_reload_string (GDM_KEY_BACKGROUND_COLOR) ||
- gdm_config_reload_int (GDM_KEY_BACKGROUND_TYPE)) {
-
- if (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE) != GDM_BACKGROUND_NONE) {
- gdm_common_setup_background_color (gdm_config_get_string
- (GDM_KEY_BACKGROUND_COLOR));
- }
- }
-
- gdmcomm_comm_bulk_stop ();
-
- return TRUE;
-}
-
-
-static void
-gdm_chooser_signals_init (void)
-{
- struct sigaction hup;
- struct sigaction term;
- sigset_t mask;
-
- ve_signal_add (SIGHUP, gdm_reread_config, NULL);
-
- hup.sa_handler = ve_signal_notify;
- hup.sa_flags = 0;
- sigemptyset (&hup.sa_mask);
- sigaddset (&hup.sa_mask, SIGCHLD);
-
- term.sa_handler = gdm_chooser_cancel;
- term.sa_flags = 0;
- sigemptyset (&term.sa_mask);
-
- if (sigaction (SIGHUP, &hup, NULL) < 0) {
- gdm_common_fail_exit ("%s: Error setting up %s signal handler: %s",
- "gdm_signals_init", "HUP", strerror (errno));
- }
-
- if (sigaction (SIGINT, &term, NULL) < 0) {
- gdm_common_fail_exit ("%s: Error setting up %s signal handler: %s",
- "gdm_signals_init", "INT", strerror (errno));
- }
-
- if (sigaction (SIGTERM, &term, NULL) < 0) {
- gdm_common_fail_exit ("%s: Error setting up %s signal handler: %s",
- "gdm_signals_init", "TERM", strerror (errno));
- }
-
- sigfillset (&mask);
- sigdelset (&mask, SIGTERM);
- sigdelset (&mask, SIGHUP);
- sigdelset (&mask, SIGINT);
-
- if (sigprocmask (SIG_SETMASK, &mask, NULL) == -1)
- gdm_common_fail_exit ("Could not set signal mask!");
-}
-
-GOptionEntry chooser_options [] = {
- { "xdmaddress", '\0', 0, G_OPTION_ARG_STRING, &xdm_address,
- N_("Socket for xdm communication"), N_("SOCKET") },
- { "clientaddress", '\0', 0, G_OPTION_ARG_STRING, &client_address,
- N_("Client address to return in response to xdm"), N_("ADDRESS") },
- { "connectionType", '\0', 0, G_OPTION_ARG_INT, &connection_type,
- N_("Connection type to return in response to xdm"), N_("TYPE") },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &chooser_hosts,
- NULL, NULL },
- { NULL }
- };
-
-static gboolean
-gdm_event (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GdkEvent *event;
-
- /* HAAAAAAAAAAAAAAAAACK */
- /* Since the user has not logged in yet and may have left/right
- * mouse buttons switched, we just translate every right mouse click
- * to a left mouse click */
- if (n_param_values != 2 ||
- !G_VALUE_HOLDS (&param_values[1], GDK_TYPE_EVENT))
- return FALSE;
-
- event = g_value_get_boxed (&param_values[1]);
- if ((event->type == GDK_BUTTON_PRESS ||
- event->type == GDK_2BUTTON_PRESS ||
- event->type == GDK_3BUTTON_PRESS ||
- event->type == GDK_BUTTON_RELEASE)
- && event->button.button == 3)
- event->button.button = 1;
-
- return TRUE;
-}
-
-int
-main (int argc, char *argv[])
-{
- gchar *GdmHosts;
- gchar **hosts_opt = NULL;
- GOptionContext *ctx;
- const char *gdm_version;
- int i;
- guint sid;
-
- stored_argv = g_new0 (char *, argc + 1);
- for (i = 0; i < argc; i++)
- stored_argv[i] = g_strdup (argv[i]);
- stored_argv[i] = NULL;
- stored_argc = argc;
-
- if (g_getenv ("RUNNING_UNDER_GDM") != NULL)
- RUNNING_UNDER_GDM = TRUE;
-
- gdm_common_openlog ("gdmchooser", LOG_PID, LOG_DAEMON);
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- gtk_init (&argc, &argv);
-
- ctx = g_option_context_new (_("- gdm login chooser"));
- g_option_context_add_main_entries(ctx, chooser_options, _("main options"));
- g_option_context_parse(ctx, &argc, &argv, NULL);
- g_option_context_free(ctx);
-
- glade_init ();
-
- /* Read all configuration at once, so the values get cached */
- gdm_read_config ();
-
- GdmHosts = g_strdup (gdm_config_get_string (GDM_KEY_HOSTS));
-
- /* if broadcasting, then append BROADCAST to hosts */
- if (gdm_config_get_bool (GDM_KEY_BROADCAST)) {
- gchar *tmp;
- if (ve_string_empty (GdmHosts)) {
- tmp = "BROADCAST";
- } else {
- tmp = g_strconcat (GdmHosts, ",BROADCAST", NULL);
- }
- g_free (GdmHosts);
- GdmHosts = tmp;
- }
-
-#ifdef ENABLE_IPV6
- if (gdm_config_get_bool (GDM_KEY_MULTICAST)) {
- gchar *tmp;
- if (ve_string_empty (GdmHosts)) {
- tmp = "MULTICAST";
- } else {
- tmp = g_strconcat (GdmHosts, ",MULTICAST", NULL);
- }
- g_free (GdmHosts);
- GdmHosts = tmp;
- }
-#endif
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_screen_init (gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN));
-
- gdm_version = g_getenv ("GDM_VERSION");
-
- /* Load the background as early as possible so GDM does not leave */
- /* the background unfilled. The cursor should be a watch already */
- /* but just in case */
- if (RUNNING_UNDER_GDM) {
- if (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE) != GDM_BACKGROUND_NONE)
- gdm_common_setup_background_color (gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR));
-
- gdm_common_setup_cursor (GDK_WATCH);
- }
-
- if (RUNNING_UNDER_GDM &&
- gdm_version != NULL &&
- strcmp (gdm_version, VERSION) != 0) {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
-
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The chooser version (%s) does not match the daemon "
- "version (%s). "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION, gdm_version);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot run chooser"),
- msg);
- g_free (msg);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
-
- return EXIT_SUCCESS;
- }
-
- gtk_window_set_default_icon_from_file (DATADIR"/pixmaps/gdm-xnest.png", NULL);
-
- gdm_chooser_gui_init ();
- gdm_chooser_signals_init ();
-
- /* when no hosts on the command line, take them from the config */
- if (hosts_opt == NULL ||
- hosts_opt[0] == NULL) {
- int i;
- hosts_opt = g_strsplit (GdmHosts, ",", -1);
- for (i = 0; hosts_opt != NULL && hosts_opt[i] != NULL; i++) {
- g_strstrip (hosts_opt[i]);
- }
- }
- gdm_chooser_xdmcp_init (hosts_opt);
- g_strfreev (hosts_opt);
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- gtk_widget_queue_resize (chooser);
- gtk_widget_show_now (chooser);
-
- if (RUNNING_UNDER_GDM)
- gdm_wm_center_window (GTK_WINDOW (chooser));
-
- if (RUNNING_UNDER_GDM &&
- /* can it ever happen that it'd be NULL here ??? */
- chooser->window != NULL) {
- gdm_wm_init (GDK_WINDOW_XWINDOW (chooser->window));
-
- /* Run the focus, note that this will work no matter what
- * since gdm_wm_init will set the display to the gdk one
- * if it fails */
- gdm_wm_focus_window (GDK_WINDOW_XWINDOW (chooser->window));
- }
-
- if (gdm_config_get_bool (GDM_KEY_ALLOW_ADD))
- gtk_widget_grab_focus (add_entry);
-
- gdm_chooser_add_entry_changed ();
-
- if (RUNNING_UNDER_GDM) {
- gdm_wm_restore_wm_order ();
- gdm_common_setup_cursor (GDK_LEFT_PTR);
- }
-
- gtk_main ();
-
- exit (EXIT_SUCCESS);
-}
-
-/* EOF */
diff --git a/gui/gdmchooser.glade b/gui/gdmchooser.glade
deleted file mode 100644
index ee7ad359..00000000
--- a/gui/gdmchooser.glade
+++ /dev/null
@@ -1,318 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="gdmchooser_main">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Login Host Chooser</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_NONE</property>
- <property name="modal">False</property>
- <property name="default_height">500</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
- <signal name="delete_event" handler="gdm_chooser_cancel" last_modification_time="Tue, 23 Apr 2002 20:39:41 GMT"/>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="help_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">How to use this application</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="response_id">-11</property>
- <signal name="clicked" handler="display_chooser_information" last_modification_time="Tue, 23 Apr 2002 20:42:13 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="rescan_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Probe the network</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-refresh</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="gdm_chooser_xdmcp_discover" last_modification_time="Tue, 23 Apr 2002 20:41:11 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="quit_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Exit the application</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">-6</property>
- <signal name="clicked" handler="gdm_chooser_cancel" last_modification_time="Tue, 23 Apr 2002 20:42:38 GMT"/>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="connect_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Open a session to the selected host</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="response_id">0</property>
- <signal name="clicked" handler="gdm_chooser_manage" last_modification_time="Tue, 23 Apr 2002 20:40:54 GMT"/>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <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>
-
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-jump-to</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="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">C_onnect</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>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox1">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="status_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Status</property>
- <property name="use_underline">True</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</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>
- <property name="mnemonic_widget">chooser_iconlist</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </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_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="chooser_iconlist">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">True</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</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="GtkHBox" id="add_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="add_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_dd host: </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">add_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="add_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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="activates_default">False</property>
- <signal name="activate" handler="gdm_chooser_add_host" last_modification_time="Tue, 03 Jun 2003 19:25:52 GMT"/>
- <signal name="changed" handler="gdm_chooser_add_entry_changed" last_modification_time="Sun, 20 Jul 2003 17:47:14 GMT"/>
- </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>
-
- <child>
- <widget class="GtkButton" id="add_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Query and add this host to the above list</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Add</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <signal name="clicked" handler="gdm_chooser_add_host" last_modification_time="Tue, 03 Jun 2003 19:26:04 GMT"/>
- </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>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/gui/gdmcomm.c b/gui/gdmcomm.c
deleted file mode 100644
index 0e8ec352..00000000
--- a/gui/gdmcomm.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * GDMcommunication routines
- * (c)2001 Queen of England, (c)2002,2003 George Lebl
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <X11/Xauth.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/un.h>
-#include <errno.h>
-
-#include "vicious.h"
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmcomm.h"
-#include "gdmconfig.h"
-
-static gboolean bulk_acs = FALSE;
-static gboolean debug = FALSE;
-static gboolean quiet = FALSE;
-static int num_cmds = 0;
-
-/*
- * Note, in this function we have to call gdm_common_error instead
- * of gdm_common_debug, since gdm_common_debug accesses the
- * GDM_KEY_DEBUG which can cause a sockets connection to get the
- * config data, causing an infinite loop. This is why clients must
- * call the gdmcomm_set_debug function to turn on debug for these
- * functions.
- */
-void
-gdmcomm_set_debug (gboolean enable)
-{
- debug = enable;
-}
-
-/*
- * Normally errors are printed. Setting quiet to TRUE turns off
- * display of error messages.
- */
-void
-gdmcomm_set_quiet_errors (gboolean enable)
-{
- quiet = enable;
-}
-
-static char *
-do_command (int fd, const char *command, gboolean get_response)
-{
- GString *str;
- char buf[1];
- char *cstr;
- int ret;
-#ifndef MSG_NOSIGNAL
- void (*old_handler)(int);
-#endif
-
- if (debug) {
- gdm_common_error ("Sending command: '%s'", command);
- }
-
- cstr = g_strdup_printf ("%s\n", command);
-
-#ifdef MSG_NOSIGNAL
- ret = send (fd, cstr, strlen (cstr), MSG_NOSIGNAL);
-#else
- old_handler = signal (SIGPIPE, SIG_IGN);
- ret = send (fd, cstr, strlen (cstr), 0);
- signal (SIGPIPE, old_handler);
-#endif
- g_free (cstr);
-
- num_cmds++;
-
- if (ret < 0) {
- if ( !quiet)
- gdm_common_error ("Command failed, no data returned");
- return NULL;
- }
-
- /* No need to print debug, this is only used when closing */
- if ( ! get_response)
- return NULL;
-
- str = g_string_new (NULL);
- while (read (fd, buf, 1) == 1 &&
- buf[0] != '\n') {
- g_string_append_c (str, buf[0]);
- }
-
- if (debug)
- gdm_common_error (" Got response: '%s'", str->str);
-
- cstr = str->str;
- g_string_free (str, FALSE);
-
- /*
- * If string is empty, then the daemon likely closed the connection
- * because of too many subconnections. At any rate the daemon should
- * not return an empty string. All return values should start with
- * "OK" or "ERROR". Daemon should never complain about too many
- * messages since the slave keeps track of the number of commands sent
- * and should not send too many, but it does not hurt to check and
- * manage it if it somehow happens. In either case return NULL
- * instead so the caller can try again.
- */
- if (ve_string_empty (cstr) ||
- strcmp (ve_sure_string (cstr), "ERROR 200 Too many messages") == 0) {
- if ( !quiet)
- gdm_common_error ("Command failed, daemon busy.");
- g_free (cstr);
- return NULL;
- }
-
- return cstr;
-}
-
-static gboolean
-version_ok_p (const char *version, const char *min_version)
-{
- int a = 0, b = 0, c = 0, d = 0;
- int mina = 0, minb = 0, minc = 0, mind = 0;
-
- /* Note that if some fields in the version don't exist, then
- * we don't mind, they are zero */
- sscanf (version, "%d.%d.%d.%d", &a, &b, &c, &d);
- sscanf (min_version, "%d.%d.%d.%d", &mina, &minb, &minc, &mind);
-
- if ((a > mina) ||
- (a == mina && b > minb) ||
- (a == mina && b == minb && c > minc) ||
- (a == mina && b == minb && c == minc && d >= mind))
- return TRUE;
- else
- return FALSE;
-}
-
-static gboolean allow_sleep = TRUE;
-static gboolean did_sleep_on_failure = FALSE;
-static int comm_fd = 0;
-
-static char *
-gdmcomm_call_gdm_real (const char *command,
- const char *auth_cookie,
- const char *min_version,
- int tries,
- int try_start)
-{
- char *ret;
-
- /*
- * If already sent the max number of commands, close the connection
- * and reopen. Subtract 1 to allow the "CLOSE" to get through.
- */
- if (num_cmds == (GDM_SUP_MAX_MESSAGES - 1)) {
- if (debug)
- gdm_common_error (" Closing and reopening connection.");
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- num_cmds = 0;
- }
-
- if (tries <= 0) {
- if ( !quiet)
- gdm_common_error (" Command failed %d times, aborting.", try_start);
- return NULL;
- }
-
- if (!quiet && tries != try_start) {
- gdm_common_error (" Trying failed command again. Try %d of %d.",
- (try_start - tries + 1), try_start);
- }
-
- if (comm_fd <= 0) {
- struct sockaddr_un addr;
- strcpy (addr.sun_path, GDM_SUP_SOCKET);
- addr.sun_family = AF_UNIX;
- comm_fd = socket (AF_UNIX, SOCK_STREAM, 0);
- if (comm_fd < 0) {
- if ( !quiet)
- gdm_common_error (" Failed to open socket");
-
- return gdmcomm_call_gdm_real (command, auth_cookie, min_version, tries - 1, try_start);
- }
-
- if (connect (comm_fd, (struct sockaddr *)&addr, sizeof (addr)) < 0) {
-
-
- /*
- * If there is a failure on connect, there are probably
- * other clients fighting for the connection, so sleep
- * for 1 second before retry to avoid failing over and
- * over in a tight loop.
- *
- * Only do this if allow_sleep is true. allow_sleep
- * will get set to FALSE if the first call to this
- * function fails all retries.
- */
- if (allow_sleep == TRUE) {
-
- did_sleep_on_failure = TRUE;
-
- /*
- * Only actualy sleep if we are going to try
- * again.
- */
- if (tries > 1) {
- if ( !quiet)
- gdm_common_error (" Failed to connect to socket, sleep 1 second and retry");
- sleep (1);
- }
- } else {
- if ( !quiet)
- gdm_common_error (" Failed to connect to socket, not sleeping");
- }
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return gdmcomm_call_gdm_real (command, auth_cookie,
- min_version, tries - 1, try_start);
- }
-
- /*
- * If we get this far, then even if we did sleep in the past,
- * we did get a connection, so no need to prevent future
- * sleeps if required.
- */
- allow_sleep = TRUE;
- did_sleep_on_failure = FALSE;
-
- /* Version check first - only check first time */
- ret = do_command (comm_fd, GDM_SUP_VERSION, TRUE);
- if (ret == NULL) {
- if ( !quiet)
- gdm_common_error (" Version check failed");
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return gdmcomm_call_gdm_real (command, auth_cookie,
- min_version, tries - 1, try_start);
- }
- if (strncmp (ret, "GDM ", strlen ("GDM ")) != 0) {
- if ( !quiet)
- gdm_common_error (" Version check failed, bad name");
-
- g_free (ret);
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return NULL;
- }
- if ( ! version_ok_p (&ret[4], min_version)) {
- if ( !quiet)
- gdm_common_error (" Version check failed, bad version");
- g_free (ret);
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return NULL;
- }
- g_free (ret);
- }
-
- /* require authentication */
- if (auth_cookie != NULL) {
- char *auth_cmd = g_strdup_printf
- (GDM_SUP_AUTH_LOCAL " %s", auth_cookie);
- ret = do_command (comm_fd, auth_cmd, TRUE);
- g_free (auth_cmd);
- if (ret == NULL) {
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return gdmcomm_call_gdm_real (command, auth_cookie,
- min_version, tries - 1, try_start);
- }
- /* not auth'ed */
- if (strcmp (ve_sure_string (ret), "OK") != 0) {
- if ( !quiet)
- gdm_common_error (" Error, auth check failed");
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- /* returns the error */
- return ret;
- }
- g_free (ret);
- }
-
- ret = do_command (comm_fd, command, TRUE);
- if (ret == NULL) {
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- return gdmcomm_call_gdm_real (command, auth_cookie,
- min_version, tries - 1, try_start);
- }
-
- /*
- * We want to leave the connection open if bulk_acs is set to
- * true, so clients can read as much config data in one
- * sockets connection when it is set. This requires that
- * GDM client programs ensure that they call the bulk_start
- * and bulk_stop functions around blocks of code that
- * need to read data in bulk. If a client reads config data
- * outside of the bulk_start/stop functions, then this
- * will just negatively affect performance since an additional
- * socket will be opened to read that config data.
- */
- if (bulk_acs == FALSE) {
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- comm_fd = 0;
- }
-
- return ret;
-}
-
-char *
-gdmcomm_call_gdm (const char *command, const char * auth_cookie,
- const char *min_version, int tries)
-{
-
- char *retstr;
-
- retstr = gdmcomm_call_gdm_real (command, auth_cookie, min_version,
- tries, tries);
-
- /*
- * Disallow sleeping on future calls if it failed to connect.
- * did_sleep_on_failure will only be TRUE if the function returned
- * without ever connecting.
- */
- if (did_sleep_on_failure == TRUE)
- allow_sleep = FALSE;
-
- return (retstr);
-}
-
-/**
- * gdmcomm_did_connection_fail
- *
- * If allow_sleep is TRUE, then connection was able to go through.
- * so the client can call this function after calling to see if
- * the failure was due to the connection being too busy. This is
- * useful for gdmdynamic.
- */
-gboolean
-gdmcomm_did_connection_fail (void)
-{
- return !allow_sleep;
-}
-
-void
-gdmcomm_set_allow_sleep (gboolean val)
-{
- allow_sleep = val;
-}
-
-void
-gdmcomm_comm_bulk_start (void)
-{
- bulk_acs = TRUE;
-}
-
-void
-gdmcomm_comm_bulk_stop (void)
-{
- /* Close the connection */
- if (comm_fd > 0) {
- do_command (comm_fd, GDM_SUP_CLOSE, FALSE);
- VE_IGNORE_EINTR (close (comm_fd));
- }
- comm_fd = 0;
- num_cmds = 0;
- bulk_acs = FALSE;
-}
-
-const char *
-gdmcomm_get_display (void)
-{
- static char *display = NULL;
-
- if (display == NULL) {
- char *p;
-
- display = gdk_get_display ();
- if (display == NULL) {
- display = g_strdup (g_getenv ("DISPLAY"));
- if (display == NULL) /*eek!*/ {
- display = g_strdup (":0");
- }
- }
-
- /* whack screen part, GDM doesn't like those */
- p = strchr (display, '.');
- if (p != NULL)
- *p = '\0';
- }
-
- return display;
-}
-
-static char *
-get_dispnum (void)
-{
- static char *number = NULL;
-
- if (number == NULL) {
- char *p;
- number = g_strdup (gdmcomm_get_display ());
-
- /* whee! handles even DECnet */
- number = strchr (number, ':');
- if (number != NULL) {
- while (*number == ':') {
- number++;
- }
- p = strchr (number, '.');
- if (p != NULL)
- *p = '\0';
- } else {
- number = "0";
- }
- }
-
- return number;
-}
-
-/* This just gets a cookie of MIT-MAGIC-COOKIE-1 type */
-char *
-gdmcomm_get_a_cookie (gboolean binary)
-{
- FILE *fp;
- char *number;
- char *cookie = NULL;
- Xauth *xau;
-
- VE_IGNORE_EINTR (fp = fopen (XauFileName (), "r"));
- if (fp == NULL) {
- return NULL;
- }
-
- number = get_dispnum ();
-
- cookie = NULL;
-
- while ((xau = XauReadAuth (fp)) != NULL) {
- /* Just find the FIRST magic cookie, that's what gdm uses */
- if (xau->number_length != strlen (number) ||
- strncmp (xau->number, number, xau->number_length) != 0 ||
- /* gdm sends MIT-MAGIC-COOKIE-1 cookies of length 16,
- * so just do those */
- xau->data_length != 16 ||
- xau->name_length != strlen ("MIT-MAGIC-COOKIE-1") ||
- strncmp (xau->name, "MIT-MAGIC-COOKIE-1",
- xau->name_length) != 0) {
- XauDisposeAuth (xau);
- continue;
- }
-
- if (binary) {
- cookie = g_new0 (char, 16);
- memcpy (cookie, xau->data, 16);
- } else {
- int i;
- GString *str;
-
- str = g_string_new (NULL);
-
- for (i = 0; i < xau->data_length; i++) {
- g_string_append_printf
- (str, "%02x",
- (guint)(guchar)xau->data[i]);
- }
- cookie = g_string_free (str, FALSE);
- }
-
- XauDisposeAuth (xau);
-
- break;
- }
- VE_IGNORE_EINTR (fclose (fp));
-
- return cookie;
-}
-
-char *
-gdmcomm_get_auth_cookie (void)
-{
- FILE *fp;
- char *number;
- static gboolean tried = FALSE;
- static char *cookie = NULL;
- Xauth *xau;
-
- if (tried)
- return cookie;
-
- VE_IGNORE_EINTR (fp = fopen (XauFileName (), "r"));
- if (fp == NULL) {
- cookie = NULL;
- tried = TRUE;
- return NULL;
- }
-
- number = get_dispnum ();
-
- cookie = NULL;
-
- while ((xau = XauReadAuth (fp)) != NULL) {
- char *cmd;
- char *ret;
- int i;
- char buffer[40 /* 2*16 == 32, so 40 is enough */];
-
- /* Only Family local things are considered, all console
- * logins DO have this family (and even some local xdmcp
- * logins, though those will not pass by gdm itself of
- * course) */
- if (xau->family != FamilyLocal ||
- xau->number_length != strlen (number) ||
- strncmp (xau->number, number, xau->number_length) != 0 ||
- /* gdm sends MIT-MAGIC-COOKIE-1 cookies of length 16,
- * so just do those */
- xau->data_length != 16 ||
- xau->name_length != strlen ("MIT-MAGIC-COOKIE-1") ||
- strncmp (xau->name, "MIT-MAGIC-COOKIE-1",
- xau->name_length) != 0 ||
- xau->data_length != 16) {
- XauDisposeAuth (xau);
- continue;
- }
-
- buffer[0] = '\0';
- for (i = 0; i < 16; i++) {
- char sub[3];
- g_snprintf (sub, sizeof (sub), "%02x",
- (guint)(guchar)xau->data[i]);
- strcat (buffer, sub);
- }
-
- XauDisposeAuth (xau);
-
- cmd = g_strdup_printf (GDM_SUP_AUTH_LOCAL " %s", buffer);
- ret = gdmcomm_call_gdm (cmd, NULL /* auth cookie */, "2.2.4.0", 5);
- g_free (cmd);
- if (ret != NULL &&
- strcmp (ve_sure_string (ret), "OK") == 0) {
- g_free (ret);
- cookie = g_strdup (buffer);
- break;
- }
- g_free (ret);
- }
- VE_IGNORE_EINTR (fclose (fp));
-
- tried = TRUE;
- return cookie;
-}
-
-gboolean
-gdmcomm_check (gboolean show_dialog)
-{
- GtkWidget *dialog;
- FILE *fp = NULL;
- long pid;
- char *pidfile;
- struct stat s;
- int statret;
-
- pidfile = GDM_PID_FILE;
-
- pid = 0;
- if (pidfile != NULL)
- VE_IGNORE_EINTR (fp = fopen (pidfile, "r"));
- if (fp != NULL) {
- int r;
- VE_IGNORE_EINTR (r = fscanf (fp, "%ld", &pid));
- VE_IGNORE_EINTR (fclose (fp));
- if (r != 1)
- pid = 0;
- }
-
- errno = 0;
- if (pid <= 1 ||
- (kill (pid, 0) < 0 &&
- errno != EPERM)) {
- if (show_dialog) {
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("GDM (The GNOME Display Manager) "
- "is not running."),
- _("You might in fact be using a different "
- "display manager, such as KDM "
- "(KDE Display Manager) or xdm. "
- "If you still wish to use this feature, "
- "either start GDM yourself or ask your "
- "system administrator to start GDM."));
-
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
- return FALSE;
- }
-
- VE_IGNORE_EINTR (statret = g_stat (GDM_SUP_SOCKET, &s));
- if (statret < 0 ||
- s.st_uid != 0 ||
- g_access (GDM_SUP_SOCKET, R_OK|W_OK) != 0) {
- if (show_dialog) {
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Cannot communicate with GDM "
- "(The GNOME Display Manager)"),
- _("Perhaps you have an old version "
- "of GDM running."));
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
- return FALSE;
- }
-
- return TRUE;
-}
-
-const char *
-gdmcomm_get_error_message (const char *ret, gboolean use_xnest)
-{
- /* These need a bit more refinement */
- if (ret == NULL) {
- return _("Cannot communicate with GDM. Perhaps "
- "you have an old version running.");
- } else if (strncmp (ret, "ERROR 0 ", strlen ("ERROR 0 ")) == 0) {
- return _("Cannot communicate with GDM. Perhaps "
- "you have an old version running.");
- } else if (strncmp (ret, "ERROR 1 ", strlen ("ERROR 1 ")) == 0) {
- return _("The allowed limit of flexible X servers reached.");
- } else if (strncmp (ret, "ERROR 2 ", strlen ("ERROR 2 ")) == 0) {
- return _("There were errors trying to start the X server.");
- } else if (strncmp (ret, "ERROR 3 ", strlen ("ERROR 3 ")) == 0) {
- return _("The X server failed. Perhaps it is not "
- "configured well.");
- } else if (strncmp (ret, "ERROR 4 ", strlen ("ERROR 4 ")) == 0) {
- return _("Too many X sessions running.");
- } else if (strncmp (ret, "ERROR 5 ", strlen ("ERROR 5 ")) == 0) {
- return _("The nested X server (Xnest) cannot connect to "
- "your current X server. You may be missing an "
- "X authorization file.");
- } else if (strncmp (ret, "ERROR 6 ", strlen ("ERROR 6 ")) == 0) {
- if (use_xnest)
- return _("The nested X server (Xnest) is not "
- "available, or GDM is badly configured.\n"
- "Please install the Xnest package in "
- "order to use the nested login.");
- else
- return _("The X server is not available. "
- "GDM may be misconfigured.");
- } else if (strncmp (ret, "ERROR 7 ", strlen ("ERROR 7 ")) == 0) {
- return _("Trying to set an unknown logout action, or trying "
- "to set a logout action which is not available.");
- } else if (strncmp (ret, "ERROR 8 ", strlen ("ERROR 8 ")) == 0) {
- return _("Virtual terminals not supported.");
- } else if (strncmp (ret, "ERROR 9 ", strlen ("ERROR 9 ")) == 0) {
- return _("Trying to change to an invalid virtual terminal number.");
- } else if (strncmp (ret, "ERROR 50 ", strlen ("ERROR 50 ")) == 0) {
- return _("Trying to update an unsupported configuration key.");
- } else if (strncmp (ret, "ERROR 100 ", strlen ("ERROR 100 ")) == 0) {
- return _("You do not seem to have the authentication needed "
- "for this operation. Perhaps your .Xauthority "
- "file is not set up correctly.");
- } else if (strncmp (ret, "ERROR 200 ", strlen ("ERROR 200 ")) == 0) {
- return _("Too many messages were sent to GDM and it hung up "
- "on us.");
- } else {
- return _("Unknown error occurred.");
- }
-}
-
diff --git a/gui/gdmcomm.h b/gui/gdmcomm.h
deleted file mode 100644
index 5458db1d..00000000
--- a/gui/gdmcomm.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * GDM - THe GNOME Display Manager
- * Copyright (C) 2001 Queen of England, (c)2002 George Lebl
- *
- * GDMcommunication routines
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef GDMCOMM_H
-#define GDMCOMM_H
-
-void gdmcomm_set_debug (gboolean enable);
-void gdmcomm_set_quiet_errors (gboolean enable);
-char * gdmcomm_call_gdm (const char *command,
- const char *auth_cookie,
- const char *min_version,
- int tries);
-gboolean gdmcomm_did_connection_fail (void);
-void gdmcomm_set_allow_sleep (gboolean val);
-void gdmcomm_comm_bulk_start (void);
-void gdmcomm_comm_bulk_stop (void);
-const char * gdmcomm_get_display (void);
-
-/* This just gets a cookie of MIT-MAGIC-COOKIE-1 type */
-char * gdmcomm_get_a_cookie (gboolean binary);
-
-/* get the gdm auth cookie */
-char * gdmcomm_get_auth_cookie (void);
-
-gboolean gdmcomm_check (gboolean show_dialog);
-const char * gdmcomm_get_error_message (const char *ret,
- gboolean use_xnest);
-
-#endif /* GDMCOMM_H */
diff --git a/gui/gdmcommon.c b/gui/gdmcommon.c
deleted file mode 100644
index c2be434a..00000000
--- a/gui/gdmcommon.c
+++ /dev/null
@@ -1,845 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDM - The GNOME Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 "config.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <locale.h>
-#include <string.h>
-#include <syslog.h>
-#include <time.h>
-#include <sys/utsname.h>
-#include <sys/types.h>
-#include <signal.h>
-
-#include <glib/gi18n.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmcomm.h"
-#include "gdmconfig.h"
-
-gint gdm_timed_delay = 0;
-static Atom AT_SPI_IOR;
-
-/*
- * Some slaves want to send output to syslog and others (such as
- * gdmflexiserver and gdmdynamic send error messages to stdout.
- * Calling gdm_common_openlog to open the syslog sets the
- * using_syslog flag so that calls to gdm_common_fail,
- * gdm_common_info, gdm_common_error, and gdm_common_debug sends
- * output to the syslog if the syslog has been opened, otherwise
- * send to stdout.
- */
-static gboolean using_syslog = FALSE;
-
-void
-gdm_common_openlog (const char *ident, int logopt, int facility)
-{
- openlog (ident, logopt, facility);
- using_syslog = TRUE;
-}
-
-void
-gdm_common_fail_exit (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- if (!format) {
- _exit (EXIT_FAILURE);
- }
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- if (using_syslog) {
- syslog (LOG_ERR, "%s", s);
- closelog ();
- } else
- g_printf ("%s\n", s);
-
- g_free (s);
-
- _exit (EXIT_FAILURE);
-}
-
-void
-gdm_common_fail_greeter (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- if (!format) {
- _exit (DISPLAY_GREETERFAILED);
- }
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- if (using_syslog) {
- syslog (LOG_ERR, "%s", s);
- closelog ();
- } else
- g_printf ("%s\n", s);
-
- g_free (s);
-
- _exit (DISPLAY_GREETERFAILED);
-}
-
-void
-gdm_common_info (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- if (using_syslog)
- syslog (LOG_INFO, "%s", s);
- else
- g_printf ("%s\n", s);
-
- g_free (s);
-}
-
-void
-gdm_common_error (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- if (using_syslog)
- syslog (LOG_ERR, "%s", s);
- else
- g_printf ("%s\n", s);
-
- g_free (s);
-}
-
-void
-gdm_common_warning (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- if (using_syslog)
- syslog (LOG_WARNING, "%s", s);
- else
- g_printf ("%s\n", s);
-
- g_free (s);
-}
-
-void
-gdm_common_debug (const gchar *format, ...)
-{
- va_list args;
- gchar *s;
-
- if G_LIKELY (! gdm_config_get_bool (GDM_KEY_DEBUG))
- return;
-
- va_start (args, format);
- s = g_strdup_vprintf (format, args);
- va_end (args);
-
- syslog (LOG_ERR, "%s", s);
- closelog ();
- g_free (s);
-}
-
-void
-gdm_common_setup_cursor (GdkCursorType type)
-{
- GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
- gdk_cursor_unref (cursor);
-}
-
-void
-gdm_common_login_sound (const gchar *GdmSoundProgram,
- const gchar *GdmSoundOnLoginReadyFile,
- gboolean GdmSoundOnLoginReady)
-{
- if ( ! GdmSoundOnLoginReady)
- return;
-
- if (ve_string_empty (g_getenv ("GDM_IS_LOCAL")) ||
- ve_string_empty (GdmSoundProgram) ||
- ve_string_empty (GdmSoundOnLoginReadyFile) ||
- g_access (GdmSoundProgram, F_OK) != 0 ||
- g_access (GdmSoundOnLoginReadyFile, F_OK) != 0) {
- gdk_beep ();
- } else {
- /* login sound interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_LOGIN_SOUND);
- fflush (stdout);
- }
-}
-
-typedef struct {
- GtkWidget *entry;
- gboolean blink;
-} EntryBlink;
-
-static GSList *entries = NULL;
-static guint noblink_timeout = 0;
-
-#define NOBLINK_TIMEOUT (20*1000)
-
-static void
-setup_blink (gboolean blink)
-{
- GSList *li;
- for (li = entries; li != NULL; li = li->next) {
- EntryBlink *eb = li->data;
- if (eb->blink) {
- GtkSettings *settings
- = gtk_widget_get_settings (eb->entry);
- g_object_set (settings,
- "gtk-cursor-blink", blink, NULL);
- gtk_widget_queue_resize (eb->entry);
- }
- }
-}
-
-static gboolean
-no_blink (gpointer data)
-{
- noblink_timeout = 0;
- setup_blink (FALSE);
- return FALSE;
-}
-
-static gboolean
-delay_noblink (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- setup_blink (TRUE);
- if (noblink_timeout > 0)
- g_source_remove (noblink_timeout);
- noblink_timeout
- = g_timeout_add (NOBLINK_TIMEOUT, no_blink, NULL);
- return TRUE;
-}
-
-
-void
-gdm_common_setup_blinking (void)
-{
- guint sid;
-
- if ( ! ve_string_empty (g_getenv ("GDM_IS_LOCAL")) &&
- strncmp (ve_sure_string (g_getenv ("DISPLAY")), ":0", 2) == 0)
- return;
-
- sid = g_signal_lookup ("activate",
- GTK_TYPE_MENU_ITEM);
- if (sid != 0) {
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_noblink,
- NULL /* data */,
- NULL /* destroy_notify */);
- }
-
- sid = g_signal_lookup ("key_press_event",
- GTK_TYPE_WIDGET);
- if (sid != 0) {
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_noblink,
- NULL /* data */,
- NULL /* destroy_notify */);
- }
-
- sid = g_signal_lookup ("button_press_event",
- GTK_TYPE_WIDGET);
- if (sid != 0) {
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_noblink,
- NULL /* data */,
- NULL /* destroy_notify */);
- }
-
- noblink_timeout = g_timeout_add (NOBLINK_TIMEOUT, no_blink, NULL);
-}
-
-void
-gdm_common_setup_blinking_entry (GtkWidget *entry)
-{
- EntryBlink *eb;
- GtkSettings *settings;
-
- if ( ! ve_string_empty (g_getenv ("GDM_IS_LOCAL")) &&
- strncmp (ve_sure_string (g_getenv ("DISPLAY")), ":0", 2) == 0)
- return;
-
- eb = g_new0 (EntryBlink, 1);
-
- eb->entry = entry;
- settings = gtk_widget_get_settings (eb->entry);
- g_object_get (settings, "gtk-cursor-blink", &(eb->blink), NULL);
-
- entries = g_slist_prepend (entries, eb);
-}
-
-GdkPixbuf *
-gdm_common_get_face (const char *filename,
- const char *fallback_filename,
- guint max_width,
- guint max_height)
-{
- GdkPixbuf *pixbuf = NULL;
-
- /* If we don't have a filename then try the fallback */
- if (! filename) {
- GtkIconTheme *theme;
- int icon_size = 48;
-
- /* If we don't have a fallback then return NULL */
- if (! fallback_filename)
- return NULL;
-
- /* Try to load an icon from the theme before the fallback */
- theme = gtk_icon_theme_get_default ();
- pixbuf = gtk_icon_theme_load_icon (theme, "stock_person", icon_size, 0, NULL);
- if (! pixbuf)
- pixbuf = gdk_pixbuf_new_from_file (fallback_filename, NULL);
- } else {
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
- }
-
- if (pixbuf) {
- guint w, h;
-
- w = gdk_pixbuf_get_width (pixbuf);
- h = gdk_pixbuf_get_height (pixbuf);
-
- if (w > h && w > max_width) {
- h = h * ((gfloat) max_width / w);
- w = max_width;
- } else if (h > max_height) {
- w = w * ((gfloat) max_height / h);
- h = max_height;
- }
-
- if (w != gdk_pixbuf_get_width (pixbuf) ||
- h != gdk_pixbuf_get_height (pixbuf)) {
- GdkPixbuf *img;
-
- img = gdk_pixbuf_scale_simple (pixbuf, w, h, GDK_INTERP_BILINEAR);
- g_object_unref (pixbuf);
- pixbuf = img;
- }
- }
-
- return pixbuf;
-}
-
-gchar *
-gdm_common_get_config_file (void)
-{
- gchar *result;
- gchar *config_file;
-
- /* Get config file */
- result = gdmcomm_call_gdm ("GET_CONFIG_FILE", NULL /* auth cookie */, "2.8.0.2", 5);
- if (! result)
- return NULL;
-
- if (ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
- g_free (result);
- return NULL;
- }
-
- /* skip the "OK " */
- config_file = g_strdup (result + 3);
-
- g_free (result);
-
- return config_file;
-}
-
-gchar *
-gdm_common_get_custom_config_file (void)
-{
- gchar *result;
- gchar *config_file;
-
- /* Get config file */
- result = gdmcomm_call_gdm ("GET_CUSTOM_CONFIG_FILE", NULL /* auth cookie */, "2.8.0.2", 5);
- if (! result)
- return NULL;
-
- if (ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
- g_free (result);
- return NULL;
- }
-
- /* skip the "OK " */
- config_file = g_strdup (result + 3);
-
- g_free (result);
-
- return config_file;
-}
-
-gboolean
-gdm_common_select_time_format (void)
-{
- gchar *val = gdm_config_get_string (GDM_KEY_USE_24_CLOCK);
-
- if (val != NULL &&
- (val[0] == 'T' ||
- val[0] == 't' ||
- val[0] == 'Y' ||
- val[0] == 'y' ||
- atoi (val) != 0)) {
- return TRUE;
- } else if (val != NULL &&
- (val[0] == 'F' ||
- val[0] == 'f' ||
- val[0] == 'N' ||
- val[0] == 'n')) {
- return FALSE;
- } else {
- /* Value is "auto" (default), thus select according to
- "locale" settings. */
- char outstr[20];
- time_t t;
- struct tm *tmp;
-
- t = time(NULL);
- tmp = localtime (&t);
-
- /* if the locale does not have an AM/PM string, use 24h time */
- return (strftime (outstr, sizeof(outstr), "%p", tmp) == 0);
- }
- /* NOTREACHED */
- return TRUE;
-}
-
-/* Not to look too shaby on Xinerama setups */
-void
-gdm_common_setup_background_color (gchar *bg_color)
-{
- GdkColormap *colormap;
- GdkColor color;
-
- if (bg_color == NULL ||
- bg_color[0] == '\0' ||
- ! gdk_color_parse (bg_color, &color))
- {
- gdk_color_parse ("#007777", &color);
- }
-
- g_free (bg_color);
-
- colormap = gdk_drawable_get_colormap
- (gdk_get_default_root_window ());
- /* paranoia */
- if (colormap != NULL)
- {
- gboolean success;
- gdk_error_trap_push ();
-
- gdk_colormap_alloc_colors (colormap, &color, 1,
- FALSE, TRUE, &success);
- gdk_window_set_background (gdk_get_default_root_window (), &color);
- gdk_window_clear (gdk_get_default_root_window ());
-
- gdk_flush ();
- gdk_error_trap_pop ();
- }
-}
-
-gchar *
-gdm_common_get_welcomemsg (void)
-{
- gchar *welcomemsg;
- gchar *tempstr;
-
- /*
- * Translate the welcome msg in the client program since it is running as the
- * user and therefore has the appropriate language environment set.
- */
- if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
- if (gdm_config_get_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME))
- welcomemsg = g_strdup (_(GDM_DEFAULT_REMOTE_WELCOME_MSG));
- else {
- tempstr = gdm_config_get_translated_string (GDM_KEY_REMOTE_WELCOME);
-
- if (tempstr == NULL ||
- strcmp (ve_sure_string (tempstr), GDM_DEFAULT_REMOTE_WELCOME_MSG) == 0)
- welcomemsg = g_strdup (_(GDM_DEFAULT_REMOTE_WELCOME_MSG));
- else
- welcomemsg = g_strdup (tempstr);
- }
- } else {
- if (gdm_config_get_bool (GDM_KEY_DEFAULT_WELCOME))
- welcomemsg = g_strdup (_(GDM_DEFAULT_WELCOME_MSG));
- else {
- tempstr = gdm_config_get_translated_string (GDM_KEY_WELCOME);
-
- if (tempstr == NULL ||
- strcmp (ve_sure_string (tempstr), GDM_DEFAULT_WELCOME_MSG) == 0)
- welcomemsg = g_strdup (_(GDM_DEFAULT_WELCOME_MSG));
- else
- welcomemsg = g_strdup (tempstr);
- }
- }
-
- return welcomemsg;
-}
-
-static gchar *
-pre_fetch_prog_get_path (void)
-{
- gchar *prefetchprog;
-
- prefetchprog = gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
- if (! ve_string_empty (prefetchprog)) {
- return prefetchprog;
- } else
- return NULL;
-}
-
-static gboolean
-pre_fetch_run (gpointer data)
-{
- GPid pid = -1;
- GError *error = NULL;
- char *command = NULL;
- gchar **pre_fetch_prog_argv = NULL;
-
- command = pre_fetch_prog_get_path ();
-
- if (! command)
- return FALSE;
-
- pre_fetch_prog_argv = ve_split (command);
-
- g_spawn_async (".",
- pre_fetch_prog_argv,
- NULL,
- (GSpawnFlags) (G_SPAWN_SEARCH_PATH),
- NULL,
- NULL,
- &pid,
- &error);
-
- return FALSE;
-}
-
-static gboolean
-pre_atspi_launch (void){
- gboolean a11y = gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
- GPid pid = -1;
- GError *error = NULL;
- char *command = NULL;
- gchar **atspi_prog_argv = NULL;
-
- if (! a11y)
- return FALSE;
-
- command = g_strdup (LIBEXECDIR "/at-spi-registryd");
-
- atspi_prog_argv = ve_split (command);
-
- g_spawn_async (".",
- atspi_prog_argv,
- NULL,
- (GSpawnFlags) (G_SPAWN_SEARCH_PATH),
- NULL,
- NULL,
- &pid,
- &error);
-
- if (kill (pid, 0) < 0) {
- fprintf (stderr, "at-spi-registryd not running: %s\n", error->message);
- return FALSE;
- }
-
- return TRUE;
-
-}
-
-
-static GdkFilterReturn
-filter_watch (GdkXEvent *xevent, GdkEvent *event, gpointer data){
- XEvent *xev = (XEvent *)xevent;
-
- if (xev->xany.type == PropertyNotify &&
- xev->xproperty.atom == AT_SPI_IOR){
- gtk_main_quit ();
-
- return GDK_FILTER_REMOVE;
- }
-
- return GDK_FILTER_CONTINUE;
-}
-
-static gboolean
-filter_timeout (gpointer data)
-{
- gdm_common_info (_("The accessibility registry was not found."));
-
- gtk_main_quit ();
-
- return FALSE;
-}
-
-void
-gdm_common_atspi_launch (void)
-{
- GdkWindow *w = gdk_get_default_root_window ();
- gboolean a11y = gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
- guint tid;
-
- if (! a11y)
- return;
-
- if ( ! AT_SPI_IOR)
- AT_SPI_IOR = XInternAtom (GDK_DISPLAY (), "AT_SPI_IOR", False);
-
- gdk_window_set_events (w, GDK_PROPERTY_CHANGE_MASK);
-
- if ( ! pre_atspi_launch ()) {
- gdm_common_info (_("The accessibility registry could not be started."));
-
- return;
- }
- gdk_window_add_filter (w, filter_watch, NULL);
- tid = g_timeout_add (1e3, filter_timeout, NULL);
-
- gtk_main ();
-
- gdk_window_remove_filter (w, filter_watch, NULL);
- g_source_remove (tid);
-}
-
-void
-gdm_common_pre_fetch_launch (void)
-{
- if (! pre_fetch_prog_get_path ())
- return;
-
- g_idle_add (pre_fetch_run, NULL);
-}
-
-/*
- * Returns the string version of the time that the user
- * will need to free. Requires the user pass in the
- * the_tm structure to be used. This way the caller
- * has access to the time data as well.
- */
-gchar *
-gdm_common_get_clock (struct tm **the_tm)
-{
- char *str;
- time_t the_time;
-
- time (&the_time);
- *the_tm = localtime (&the_time);
-
- if (gdm_common_select_time_format ()) {
- str = ve_strftime (*the_tm, _("%a %b %d, %H:%M"));
- } else {
- /* Translators: You should translate time part as
- %H:%M if your language does not have AM and PM
- equivalent. Note: %l is a strftime option for
- 12-hour clock format */
- str = ve_strftime (*the_tm, _("%a %b %d, %l:%M %p"));
- }
-
- return str;
-}
-
-char *
-gdm_common_expand_text (const gchar *text)
-{
- GString *str;
- const char *p;
- gchar *clock, *display;
- int r, i, n_chars;
- gboolean underline = FALSE;
- gchar buf[256];
- struct utsname name;
- struct tm *the_tm;
-
- str = g_string_sized_new (strlen (text));
-
- p = text;
- n_chars = g_utf8_strlen (text, -1);
- i = 0;
-
- while (i < n_chars)
- {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
-
- /* Backslash commands */
- if (ch == '\\')
- {
- p = g_utf8_next_char (p);
- i++;
- ch = g_utf8_get_char (p);
-
- if (i >= n_chars || ch == '\0')
- {
- g_warning ("Unescaped \\ at end of text\n");
- goto bail;
- }
- else if (ch == 'n')
- g_string_append_unichar (str, '\n');
- else
- g_string_append_unichar (str, ch);
- }
- else if (ch == '%')
- {
- p = g_utf8_next_char (p);
- i++;
- ch = g_utf8_get_char (p);
-
- if (i >= n_chars || ch == '\0')
- {
- g_warning ("Unescaped %% at end of text\n");
- goto bail;
- }
-
- switch (ch)
- {
- case '%':
- g_string_append (str, "%");
- break;
- case 'c':
- clock = gdm_common_get_clock (&the_tm);
- g_string_append (str, clock);
- g_free (clock);
- break;
- case 'd':
- display = g_strdup (g_getenv ("DISPLAY"));
- g_string_append (str, display);
- break;
- case 'h':
- buf[sizeof (buf) - 1] = '\0';
- r = gethostname (buf, sizeof (buf) - 1);
- if (r)
- g_string_append (str, "localhost");
- else
- g_string_append (str, buf);
- break;
- case 'm':
- uname (&name);
- g_string_append (str, name.machine);
- break;
- case 'n':
- uname (&name);
- g_string_append (str, name.nodename);
- break;
- case 'o':
- buf[sizeof (buf) - 1] = '\0';
- r = getdomainname (buf, sizeof (buf) - 1);
- if (r)
- g_string_append (str, "localdomain");
- else
- g_string_append (str, buf);
- break;
- case 'r':
- uname (&name);
- g_string_append (str, name.release);
- break;
- case 's':
- uname (&name);
- g_string_append (str, name.sysname);
- break;
- case 't':
- g_string_append_printf (str, ngettext("%d second", "%d seconds", gdm_timed_delay),
- gdm_timed_delay);
- break;
- case 'u':
- g_string_append (str, ve_sure_string (g_getenv("GDM_TIMED_LOGIN_OK")));
- break;
- default:
- if (ch < 127)
- g_warning ("unknown escape code %%%c in text\n", (char)ch);
- else
- g_warning ("unknown escape code %%(U%x) in text\n", (int)ch);
- }
- }
- else if (ch == '_')
- {
- /*
- * Could be true if an underscore was put right before a special
- * character like % or /
- */
- if (underline == FALSE) {
- underline = TRUE;
- g_string_append (str, "<u>");
- }
- }
- else
- {
- g_string_append_unichar (str, ch);
- if (underline)
- {
- underline = FALSE;
- g_string_append (str, "</u>");
- }
- }
- p = g_utf8_next_char (p);
- i++;
- }
-
- bail:
-
- if (underline)
- g_string_append (str, "</u>");
-
- return g_string_free (str, FALSE);
-}
-
diff --git a/gui/gdmcommon.h b/gui/gdmcommon.h
deleted file mode 100644
index 15583767..00000000
--- a/gui/gdmcommon.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 GDM_COMMON_H
-#define GDM_COMMON_H
-
-#include <gtk/gtk.h>
-
-#include "misc.h"
-
-/* Handle error messages */
-void gdm_common_openlog (const char *ident,
- int logopt,
- int facility);
-void gdm_common_fail_exit (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-void gdm_common_fail_greeter (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-void gdm_common_info (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-void gdm_common_error (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-void gdm_common_warning (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-void gdm_common_debug (const gchar *format, ...)
- G_GNUC_PRINTF (1, 2);
-
-/* Misc. Common Functions */
-void gdm_common_setup_cursor (GdkCursorType type);
-
-void gdm_common_login_sound (const gchar *GdmSoundProgram,
- const gchar *GdmSoundOnLoginReadyFile,
- gboolean GdmSoundOnLoginReady);
-
-void gdm_common_setup_blinking (void);
-void gdm_common_setup_blinking_entry (GtkWidget *entry);
-
-GdkPixbuf *gdm_common_get_face (const char *filename,
- const char *fallback_filename,
- guint max_width,
- guint max_height);
-
-gchar* gdm_common_get_config_file (void);
-gchar* gdm_common_get_custom_config_file (void);
-gboolean gdm_common_select_time_format (void);
-void gdm_common_setup_background_color (gchar *bg_color);
-gchar* gdm_common_get_welcomemsg (void);
-void gdm_common_pre_fetch_launch (void);
-void gdm_common_atspi_launch (void);
-gchar* gdm_common_expand_text (const gchar *text);
-gchar* gdm_common_get_clock (struct tm **the_tm);
-
-#endif /* GDM_COMMON_H */
diff --git a/gui/gdmconfig.c b/gui/gdmconfig.c
deleted file mode 100644
index 24e222f6..00000000
--- a/gui/gdmconfig.c
+++ /dev/null
@@ -1,676 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDM - The GNOME Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 <stdlib.h>
-#include <gtk/gtk.h>
-
-#include "config.h"
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmcomm.h"
-#include "gdmconfig.h"
-
-#include "vicious.h"
-
-static GHashTable *int_hash = NULL;
-static GHashTable *bool_hash = NULL;
-static GHashTable *string_hash = NULL;
-static gboolean gdm_never_cache = FALSE;
-static int comm_tries = 5;
-
-/**
- * gdm_config_never_cache
- *
- * Most programs want config data to be cached to avoid constantly
- * grabbing the information over the wire and are happy calling
- * gdm_update_config to update a key value. However, gdmsetup
- * really does want the latest value each time it accesses a
- * config option. To avoid needing to call update_config
- * for each key to be retrieved, just calling this function will
- * let the config system know to always get the value via the
- * sockets connection.
- */
-void
-gdm_config_never_cache (gboolean never_cache)
-{
- gdm_never_cache = never_cache;
-}
-
-/**
- * gdm_config_set_comm_retries
- *
- * If a client wants to specify how many times it will retry to
- * get a config value, this function can be used.
- */
-void
-gdm_config_set_comm_retries (int tries)
-{
- comm_tries = tries;
-}
-
-/**
- * gdm_config_hash_lookup
- *
- * Accesses hash with key, stripping it so it doesn't contain
- * a default value.
- */
-static gpointer
-gdm_config_hash_lookup (GHashTable *hash, gchar *key)
-{
- gchar *p;
- gpointer *ret;
- gchar *newkey = g_strdup (key);
-
- g_strstrip (newkey);
- p = strchr (newkey, '=');
- if (p != NULL)
- *p = '\0';
-
- ret = g_hash_table_lookup (hash, newkey);
- g_free (newkey);
- return (ret);
-}
-
-/**
- * gdm_config_add_hash
- *
- * Adds value to hash, stripping the key so it doesn't contain
- * a default value.
- */
-static void
-gdm_config_add_hash (GHashTable *hash, gchar *key, gpointer value)
-{
- gchar *p;
- gchar *newkey = g_strdup (key);
-
- g_strstrip (newkey);
- p = strchr (newkey, '=');
- if (p != NULL)
- *p = '\0';
-
- /* Do not free the newkey since it is going into the hash. */
- g_hash_table_insert (hash, newkey, value);
-}
-
-/**
- * gdm_config_get_result
- *
- * Calls daemon to get config result, stripping the key so it
- * doesn't contain a default value.
- */
-static gchar *
-gdm_config_get_result (gchar *key)
-{
- gchar *p;
- gchar *newkey = g_strdup (key);
- gchar *command = NULL;
- gchar *result = NULL;
- static char *display = NULL;
-
- g_strstrip (newkey);
- p = strchr (newkey, '=');
- if (p != NULL)
- *p = '\0';
-
- display = g_strdup (g_getenv ("DISPLAY"));
- if (display == NULL)
- command = g_strdup_printf ("GET_CONFIG %s", newkey);
- else
- command = g_strdup_printf ("GET_CONFIG %s %s", newkey, display);
-
- result = gdmcomm_call_gdm (command, NULL /* auth cookie */,
- "2.13.0.1", comm_tries);
-
- g_free (display);
- g_free (command);
- g_free (newkey);
- return result;
-}
-
-/**
- * gdm_config_get_xserver_details
- *
- * Calls daemon to get details for an xserver config.
- */
-static gchar *
-gdm_config_get_xserver_details (gchar *xserver, gchar *key)
-{
- gchar *command = NULL;
- gchar *result = NULL;
- gchar *temp;
-
- command = g_strdup_printf ("GET_SERVER_DETAILS %s %s", xserver, key);
- result = gdmcomm_call_gdm (command, NULL /* auth cookie */,
- "2.13.0.1", comm_tries);
-
- g_free (command);
-
- if (! result || ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
-
- gdm_common_error ("Could not access xserver configuration");
-
- if (result)
- g_free (result);
- return NULL;
- }
-
- /* skip the "OK " */
- temp = g_strdup (result + 3);
- g_free (result);
-
- return temp;
-}
-
-/**
- * gdm_config_get_xservers
- *
- * Calls daemon to get xserver config.
- */
-GSList *
-gdm_config_get_xservers (gboolean flexible)
-{
- GSList *xservers = NULL;
- gchar **splitstr, **sec;
- gchar *command = NULL;
- gchar *result = NULL;
- gchar *temp;
-
- command = g_strdup_printf ("GET_SERVER_LIST");
- result = gdmcomm_call_gdm (command, NULL /* auth cookie */,
- "2.13.0.1", comm_tries);
-
- g_free (command);
-
- if (! result || ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
-
- gdm_common_error ("Could not access xserver configuration");
-
- if (result)
- g_free (result);
- return NULL;
- }
-
- /* skip the "OK " */
- splitstr = g_strsplit (result + 3, ";", 0);
- sec = splitstr;
- g_free (result);
-
- while (*sec != NULL) {
- GdmXserver *svr = g_new0 (GdmXserver, 1);
-
- temp = gdm_config_get_xserver_details (*sec, "ID");
- if (temp == NULL) {
- g_free (svr);
- continue;
- }
- svr->id = temp;
- temp = gdm_config_get_xserver_details (*sec, "NAME");
- if (temp == NULL) {
- g_free (svr);
- continue;
- }
- svr->name = temp;
- temp = gdm_config_get_xserver_details (*sec, "COMMAND");
- if (temp == NULL) {
- g_free (svr);
- continue;
- }
- svr->command = temp;
-
- temp = gdm_config_get_xserver_details (*sec, "FLEXIBLE");
- if (temp == NULL) {
- g_free (svr);
- continue;
- } else if (g_strncasecmp (ve_sure_string (temp), "true", 4) == 0)
- svr->flexible = TRUE;
- else
- svr->flexible = FALSE;
- g_free (temp);
-
- temp = gdm_config_get_xserver_details (*sec, "CHOOSABLE");
- if (temp == NULL) {
- g_free (svr);
- continue;
- } else if (g_strncasecmp (temp, "true", 4) == 0)
- svr->choosable = TRUE;
- else
- svr->choosable = FALSE;
- g_free (temp);
-
- temp = gdm_config_get_xserver_details (*sec, "HANDLED");
- if (temp == NULL) {
- g_free (svr);
- continue;
- } else if (g_strncasecmp (temp, "true", 4) == 0)
- svr->handled = TRUE;
- else
- svr->handled = FALSE;
- g_free (temp);
-
- temp = gdm_config_get_xserver_details (*sec, "CHOOSER");
- if (temp == NULL) {
- g_free (svr);
- continue;
- } else if (g_strncasecmp (temp, "true", 4) == 0)
- svr->chooser = TRUE;
- else
- svr->chooser = FALSE;
- g_free (temp);
-
- temp = gdm_config_get_xserver_details (*sec, "PRIORITY");
- if (temp == NULL) {
- g_free (svr);
- continue;
- } else {
- svr->priority = atoi (temp);
- }
- g_free (temp);
-
- sec++;
-
- /* If only flexible was requested, then skip if not flexible */
- if (flexible && !svr->flexible) {
- g_free (svr);
- continue;
- }
-
- xservers = g_slist_append (xservers, svr);
- }
-
- g_strfreev (splitstr);
- return xservers;
-}
-
-/**
- * gdm_config_get_string
- *
- * Gets string configuration value from daemon via GET_CONFIG
- * socket command. It stores the value in a hash so subsequent
- * access is faster.
- */
-static gchar *
-_gdm_config_get_string (gchar *key, gboolean reload, gboolean *changed, gboolean doing_translated)
-{
- gchar *hashretval = NULL;
- gchar *result = NULL;
- gchar *temp;
-
- if (string_hash == NULL)
- string_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- hashretval = gdm_config_hash_lookup (string_hash, key);
-
- if (reload == FALSE && hashretval != NULL)
- return hashretval;
-
- result = gdm_config_get_result (key);
-
- if ( ! result || ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
-
- gchar *getdefault;
-
- /*
- * If looking for a translated string, and not found, just return
- * NULL.
- */
- if (doing_translated) {
- if (result)
- g_free (result);
- return NULL;
- }
-
- gdm_common_error ("Could not access configuration key <%s>", key);
-
- /* Return the compiled in value associated with the key, if available. */
- getdefault = strchr (key, '=');
- if (getdefault != NULL)
- getdefault++;
-
- temp = g_strdup (getdefault);
-
- gdm_common_error ("Using compiled in value <%s> for <%s>", temp, key);
- } else {
-
- /* skip the "OK " */
- temp = g_strdup (result + 3);
- }
-
- if (result)
- g_free (result);
-
- if (hashretval == NULL) {
-
- if (changed != NULL)
- *changed = TRUE;
-
- gdm_config_add_hash (string_hash, key, temp);
- } else {
- if (changed != NULL) {
- if (strcmp (ve_sure_string (hashretval), temp) != 0)
- *changed = TRUE;
- else
- *changed = FALSE;
- }
- g_hash_table_replace (string_hash, key, temp);
- }
- return temp;
-}
-
-gchar *
-gdm_config_get_string (gchar *key)
-{
- if (gdm_never_cache == TRUE)
- return _gdm_config_get_string (key, TRUE, NULL, FALSE);
- else
- return _gdm_config_get_string (key, FALSE, NULL, FALSE);
-}
-
-/**
- * gdm_config_get_translated_string
- *
- * Gets translated string configuration value from daemon via
- * GET_CONFIG socket command. It stores the value in a hash so
- * subsequent access is faster. This does similar logic to
- * ve_config_get_trasnlated_string, requesting the value for
- * each language and returning the default value if none is
- * found.
- */
-static gchar *
-_gdm_config_get_translated_string (gchar *key, gboolean reload, gboolean *changed)
-{
- const GList *li;
- char *newkey;
- char *def;
-
- /* Strip key */
- newkey = g_strdup (key);
- def = strchr (newkey, '=');
- if (def != NULL)
- *def = '\0';
-
- for (li = ve_i18n_get_language_list ("LC_MESSAGES");
- li != NULL;
- li = li->next) {
- gchar *full = g_strdup_printf ("%s[%s]", newkey, (char *)li->data);
-
- /*
- * Pass TRUE for last argument so it doesn't print errors for
- * failing to find the key, since this is expected
- */
- gchar *val = _gdm_config_get_string (full, reload, changed, TRUE);
-
- g_free (full);
-
- if (val != NULL) {
- g_free (newkey);
- return val;
- }
- }
-
- g_free (newkey);
-
- /* Print error if it fails this time */
- return _gdm_config_get_string (key, reload, changed, FALSE);
-}
-
-gchar *
-gdm_config_get_translated_string (gchar *key)
-{
- if (gdm_never_cache == TRUE)
- return _gdm_config_get_translated_string (key, TRUE, NULL);
- else
- return _gdm_config_get_translated_string (key, FALSE, NULL);
-}
-
-/**
- * gdm_config_get_int
- *
- * Gets int configuration value from daemon via GET_CONFIG
- * socket command. It stores the value in a hash so subsequent
- * access is faster.
- */
-static gint
-_gdm_config_get_int (gchar *key, gboolean reload, gboolean *changed)
-{
- gint *hashretval = NULL;
- gchar *result = NULL;
- gint temp;
-
- if (int_hash == NULL)
- int_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- hashretval = gdm_config_hash_lookup (int_hash, key);
- if (reload == FALSE && hashretval != NULL)
- return *hashretval;
-
- result = gdm_config_get_result (key);
-
- if ( ! result || ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
-
- gchar *getdefault;
-
- gdm_common_error ("Could not access configuration key <%s>", key);
-
- /* Return the compiled in value associated with the key, if available. */
- getdefault = strchr (key, '=');
- if (getdefault != NULL)
- getdefault++;
-
- temp = atoi (getdefault);
-
- gdm_common_error ("Using compiled in value <%d> for <%s>", temp, key);
-
- } else {
-
- /* skip the "OK " */
- temp = atoi (result + 3);
- }
-
- if (result)
- g_free (result);
-
- if (hashretval == NULL) {
- gint *intval = g_new0 (gint, 1);
- *intval = temp;
- gdm_config_add_hash (int_hash, key, intval);
-
- if (changed != NULL)
- *changed = TRUE;
-
- return *intval;
- } else {
- if (changed != NULL) {
- if (*hashretval != temp)
- *changed = TRUE;
- else
- *changed = FALSE;
- }
-
- *hashretval = temp;
- return *hashretval;
- }
-}
-
-gint
-gdm_config_get_int (gchar *key)
-{
- if (gdm_never_cache == TRUE)
- return _gdm_config_get_int (key, TRUE, NULL);
- else
- return _gdm_config_get_int (key, FALSE, NULL);
-}
-
-/**
- * gdm_config_get_bool
- *
- * Gets int configuration value from daemon via GET_CONFIG
- * socket command. It stores the value in a hash so subsequent
- * access is faster.
- */
-static gboolean
-_gdm_config_get_bool (gchar *key, gboolean reload, gboolean *changed)
-{
- gboolean *hashretval = NULL;
- gchar *result;
- gboolean temp;
-
- if (bool_hash == NULL)
- bool_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- hashretval = gdm_config_hash_lookup (bool_hash, key);
- if (reload == FALSE && hashretval != NULL)
- return *hashretval;
-
- result = gdm_config_get_result (key);
-
- if ( ! result || ve_string_empty (result) ||
- strncmp (result, "OK ", 3) != 0) {
-
- gchar *getdefault;
-
- gdm_common_error ("Could not access configuration key <%s>", key);
-
- /* Return the compiled in value associated with the key, if available. */
- getdefault = strchr (key, '=');
- if (getdefault != NULL)
- getdefault++;
-
- /* Same logic as used in ve_config_get_bool */
- if (getdefault != NULL &&
- (getdefault[0] == 'T' ||
- getdefault[0] == 't' ||
- getdefault[0] == 'Y' ||
- getdefault[0] == 'y' ||
- atoi (getdefault) != 0)) {
- temp = TRUE;
- gdm_common_error ("Using compiled in value <TRUE> for <%s>", key);
- } else {
- temp = FALSE;
- gdm_common_error ("Using compiled in value <FALSE> for <%s>", key);
- }
- } else {
-
- /* skip the "OK " */
- if (strcmp (ve_sure_string (result + 3), "true") == 0)
- temp = TRUE;
- else
- temp = FALSE;
- }
-
- if (result)
- g_free (result);
-
- if (hashretval == NULL) {
- gboolean *boolval = g_new0 (gboolean, 1);
- *boolval = temp;
- gdm_config_add_hash (bool_hash, key, boolval);
-
- if (changed != NULL)
- *changed = TRUE;
-
- return *boolval;
- } else {
- if (changed != NULL) {
- if (*hashretval != temp)
- *changed = TRUE;
- else
- *changed = FALSE;
- }
-
- *hashretval = temp;
- return *hashretval;
- }
-}
-
-gboolean
-gdm_config_get_bool (gchar *key)
-{
- if (gdm_never_cache == TRUE)
- return _gdm_config_get_bool (key, TRUE, NULL);
- else
- return _gdm_config_get_bool (key, FALSE, NULL);
-}
-
-/**
- * gdm_config_reload_string
- * gdm_config_reload_int
- * gdm_config_reload_bool
- *
- * Reload values returning TRUE if value changed, FALSE
- * otherwise.
- */
-gboolean
-gdm_config_reload_string (gchar *key)
-{
- gboolean changed;
- _gdm_config_get_string (key, TRUE, &changed, FALSE);
- return changed;
-}
-
-gboolean
-gdm_config_reload_int (gchar *key)
-{
- gboolean changed;
- _gdm_config_get_int (key, TRUE, &changed);
- return changed;
-}
-
-gboolean
-gdm_config_reload_bool (gchar *key)
-{
- gboolean changed;
- _gdm_config_get_bool (key, TRUE, &changed);
- return changed;
-}
-
-void
-gdm_save_customlist_data (gchar *file, gchar *key, gchar *id)
-{
- VeConfig *cfg;
- cfg = ve_config_get (file);
- g_free (file);
- ve_config_set_string (cfg, key, ve_sure_string (id));
- ve_config_save (cfg, FALSE);
-}
-
-gchar *
-gdm_get_theme_greeter (gchar *file, const char *fallback)
-{
- VeConfig *config = ve_config_new (file);
- gchar *s;
-
- s = ve_config_get_translated_string (config, "GdmGreeterTheme/Greeter");
-
- if (s == NULL || s[0] == '\0') {
- g_free (s);
- s = g_strdup_printf ("%s.xml", fallback);
- }
-
- return s;
-}
-
diff --git a/gui/gdmconfig.h b/gui/gdmconfig.h
deleted file mode 100644
index 37f8466e..00000000
--- a/gui/gdmconfig.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * GDM - THe GNOME Display Manager
- * Copyright (C) 2001 Queen of England, (c)2002 George Lebl
- *
- * GDMcommunication routines
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#ifndef GDMCONFIG_H
-#define GDMCONFIG_H
-
-#include "ve-misc.h"
-#include "ve-miscui.h"
-
-void gdm_config_never_cache (gboolean never_cache);
-void gdm_config_set_comm_retries (int tries);
-gchar * gdm_config_get_string (gchar *key);
-gchar * gdm_config_get_translated_string (gchar *key);
-gint gdm_config_get_int (gchar *key);
-gboolean gdm_config_get_bool (gchar *key);
-gboolean gdm_config_reload_string (gchar *key);
-gboolean gdm_config_reload_int (gchar *key);
-gboolean gdm_config_reload_bool (gchar *key);
-GSList * gdm_config_get_xservers (gboolean flexible);
-
-void gdm_save_customlist_data (gchar *file,
- gchar *key,
- gchar *id);
-char * gdm_get_theme_greeter (gchar *file,
- const char *fallback);
-
-#endif /* GDMCONFIG_H */
diff --git a/gui/gdmdynamic.c b/gui/gdmdynamic.c
deleted file mode 100644
index 43fb97b8..00000000
--- a/gui/gdmdynamic.c
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
- * GDMcommunication routines
- * (c)2001 Queen of England, (c)2002,2003 George Lebl
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-#include <gdk/gdkx.h>
-#include <X11/Xauth.h>
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <libgen.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/un.h>
-#include <errno.h>
-
-#include <glib/gi18n.h>
-
-#include "gdm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-
-static char *myname = NULL; /* name of this program */
-
-static void
-usage ()
-{
- fprintf (stderr, _("Usage: %s [-b][-v] and one of the following:\n"), myname);
- fprintf (stderr, _("\t-a display\n"));
- fprintf (stderr, _("\t-r display\n"));
- fprintf (stderr, _("\t-d display\n"));
- fprintf (stderr, _("\t-l [server_name]\n"));
- fprintf (stderr, _("\t-t maximum tries to connect (default 15)\n"));
- fprintf (stderr, _("\t-s sleep value (default 8)\n"));
-}
-
-/*
- * Note: gdmdynamic does work to deal with the socket being congested
- * because it is intended that the an umlimited number of gdmdynamic
- * requests could be made at any moment. It is the responsibility of
- * gdmdynamic to manage the socket connection to the daemon to make sure
- * that it does not starve the socket, especially since the GUI login
- * program will also be using the socket on startup.
- */
-int
-main (int argc, char *argv[])
-{
- gchar *cstr;
- gchar *version;
- gchar *params = "";
- gchar *command = NULL;
- gchar *ret = NULL;
- gchar *cookie = NULL;
- int optc;
- int try_num = 0;
- int max_tries = 15;
- int sleep_val = 8;
- int verbose = 0;
- int background = 0;
- gboolean error = TRUE;
- gboolean conn_failed = FALSE;
-
- myname = basename (argv[0]);
- argv[0] = myname;
- version = "2.8.0.0";
-
- g_type_init ();
-
- /*
- * It's an error to use more than one of -a, -r, or -d, so turn
- * error to FALSE if command is not set, and TRUE if command is
- * not NULL.
- */
- while ((optc = getopt (argc, argv, "a:d:r:t:s:blv")) != EOF) {
- switch (optc) {
- case 'a':
- if (command == NULL)
- error = FALSE;
- else
- error = TRUE;
- command = GDM_SUP_ADD_DYNAMIC_DISPLAY;
- params = optarg;
- break;
-
- case 'b':
- background = 1;
- break;
-
- case 'd':
- if (command == NULL)
- error = FALSE;
- else
- error = TRUE;
- command = GDM_SUP_REMOVE_DYNAMIC_DISPLAY;
- params = optarg;
- break;
-
- case 'l':
- if (command == NULL)
- error = FALSE;
- else
- error = TRUE;
- command = GDM_SUP_ATTACHED_SERVERS;
- break;
-
- case 'r':
- if (command == NULL)
- error = FALSE;
- command = GDM_SUP_RELEASE_DYNAMIC_DISPLAYS;
- params = optarg;
- break;
-
- case 't':
- max_tries = atoi (optarg);
- break;
-
- case 's':
- sleep_val = atoi (optarg);
- break;
-
- case 'v':
- verbose++;
- break;
-
- case '?':
- error = TRUE;
- }
- }
-
- if (error) {
- usage ();
- exit (1);
- }
-
- /* process remaining option arguments for -l */
- if (command != NULL && strcmp (command, GDM_SUP_ATTACHED_SERVERS) == 0)
- for (; optind<argc; optind++)
- params = argv[optind];
-
- /* handle background option by forking and exiting the parent */
-
- if (background) {
- if ((background = fork ()) != 0) {
- if (background < 0)
- exit (1);
- else
- exit (0);
- }
- }
-
- gdmcomm_set_debug (verbose);
- /*
- * If verbose is not on, then set quiet errors to TRUE since
- * errors are expected and managed by gdmdynamic, so we want
- * errors to be quiet.
- */
- gdmcomm_set_quiet_errors (!verbose);
-
- if (params && strlen (params))
- cstr = g_strdup_printf ("%s %s", command, params);
- else
- cstr = g_strdup (command);
-
- /* Seed the random number generator in case we have to sleep. */
- srand (getpid () * time (NULL));
-
- /*
- * Setting comm_retries to 1 ensures that gdmdynamic will fail if
- * it fails the first time to connect. We manage sleeping and
- * retrying in gdmdynamic instead of wanting gdmcomm to manage
- * this.
- */
- gdm_config_set_comm_retries (1);
-
- /*
- * Never cache config data because if it fails to connect, then
- * we want it to reload config data over the socket and not
- * default to the compiled in value.
- */
- gdm_config_never_cache (TRUE);
-
- /*
- * If the connection is so busy that it fails, then we do not
- * want gdmdynamic to retry and further congest the connection.
- * Instead gdmdynamic will manage backing off and trying again
- * after waiting.
- */
- do {
- conn_failed = FALSE;
- try_num++;
-
- /*
- * Verify server is not busy, sleep if it is. No need to do this
- * check if doing LIST since this does not much much load on the
- * daemon.
- */
- if (strcmp (command, GDM_SUP_ATTACHED_SERVERS) != 0) {
- ret = gdmcomm_call_gdm (GDM_SUP_SERVER_BUSY, NULL, version, 1);
- conn_failed = gdmcomm_did_connection_fail ();
- if (ret == NULL)
- conn_failed = TRUE;
- else if (strncmp (ret, "OK", 2) == 0) {
- ret += 2;
- if (strlen (ret)) {
- ret++; /* skip over space char */
- if (strcmp (ret, "true") == 0) {
- conn_failed = TRUE;
- if (verbose)
- g_print (_("Server busy, will sleep.\n"));
- }
- }
- }
- }
-
- /* Start reading config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- /*
- * All other commands besides LIST need root cookie. Only bother
- * getting the cookie if we haven't already gotten it since we do
- * this in a loop.
- */
- if (conn_failed == FALSE &&
- (strcmp (command, GDM_SUP_ATTACHED_SERVERS) != 0) &&
- (cookie == NULL)) {
- gchar *GdmServAuthDir = NULL;
- char *filename;
- FILE *fp;
- char buf[BUFSIZ];
-
- GdmServAuthDir = gdm_config_get_string (GDM_KEY_SERV_AUTHDIR);
- conn_failed = gdmcomm_did_connection_fail ();
-
- /*
- * We can't build a cookie if the auth dir is NULL.
- * Since we only connect once, this could happen if
- * the daemon closed the connection due to too many
- * subconnections, for example. So consider this
- * getting a NULL value back a connection failed.
- */
- if (ve_string_empty (GdmServAuthDir)) {
- conn_failed = TRUE;
- }
-
- if (conn_failed == FALSE) {
-
- filename = g_build_filename (GdmServAuthDir, ".cookie", NULL);
-
- VE_IGNORE_EINTR (fp = fopen (filename, "r"));
- if (fp != NULL) {
- fgets (buf, sizeof (buf), fp);
- cookie = g_strdup (buf);
- VE_IGNORE_EINTR (fclose (fp));
- }
- g_free (filename);
- }
- }
-
- if (conn_failed == FALSE) {
- /* Allow to fail if connection fails after 1 try */
- ret = gdmcomm_call_gdm (cstr, cookie, version, 1);
-
- /* Verify the connection did not fail */
- conn_failed = gdmcomm_did_connection_fail ();
-
- /*
- * If the call returned NULL, there must be a failure
- * talking to the daemon, consider this a connection
- * failure.
- */
- if (ret == NULL) {
- conn_failed = TRUE;
- }
- }
-
- /* Done reading config data */
- gdmcomm_comm_bulk_stop ();
-
- /*
- * If the connection failed, sleep and try again. The sleep time is
- * somewhat random to ensure that if multiple calls to gdmdynamic
- * all all failing to connect that they do not retry all at the
- * same time.
- */
- if (conn_failed == TRUE) {
- /* Sleep at least 1 second */
- int rand_sleep = 1;
-
-
- /*
- * Make the sleep a bit random so if lots of calls hit the
- * server at once, they are staggared.
- */
- if (sleep_val > 0)
- rand_sleep = ((int) ((rand () % 10)/2)) + sleep_val;
-
-
- if (verbose) {
- g_print (_("Connection to daemon failed, sleeping for %d seconds. Retry %d of %d\n"),
- rand_sleep, try_num, max_tries);
- }
-
- sleep (rand_sleep);
-
- /* Reset the connection failed flag so it can be tried again */
- gdmcomm_set_allow_sleep (TRUE);
- }
- } while ((conn_failed == TRUE) && (try_num < max_tries));
-
- g_free (cstr);
- if (cookie)
- g_free (cookie);
-
- /*
- * If we failed to connect to the daemon after trying a certain number of
- * times, then return with code 2 to let the caller know that the failure
- * was due to connection problems. The caller can decide to perhaps
- * sleep a bit an try this command again.
- */
- if (conn_failed == TRUE) {
- /* This is a serious error, so print a message even if verbose is off */
- fprintf (stderr, _("Failed to connect to server after %d retries\n"),
- try_num);
- return 2;
- }
-
- if (verbose && ret != NULL)
- g_print ("%s\n", ret);
-
- if (ret != NULL &&
- strncmp (ret, "OK", 2) == 0) {
-
- if (strcmp (command, GDM_SUP_ATTACHED_SERVERS) == 0) {
- ret += 2;
- if (strlen (ret)) {
- ret++; /* skip over space char */
- g_print ("%s\n", ret);
- }
- }
-
- /* Success! */
- return 0;
- }
-
- return 1;
-}
diff --git a/gui/gdmflexiserver-xnest.desktop.in.in b/gui/gdmflexiserver-xnest.desktop.in.in
deleted file mode 100644
index b60fb549..00000000
--- a/gui/gdmflexiserver-xnest.desktop.in.in
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-_Name=New Login in a Nested Window
-_GenericName=New Login in a Nested Window
-_Comment=Log in as another user inside a nested window
-TryExec=@X_XNEST_CMD@
-Exec=gdmflexiserver --xnest
-Icon=gdm-xnest
-Terminal=false
-Type=Application
-Categories=GNOME;GTK;System;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gdm
-X-GNOME-Bugzilla-Component=general
diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c
deleted file mode 100644
index b652bb8a..00000000
--- a/gui/gdmflexiserver.c
+++ /dev/null
@@ -1,987 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDMflexiserver - run a flexible server
- * (c)2001 Queen of England
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <signal.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/un.h>
-#include <errno.h>
-#include <pwd.h>
-
-#include <glib/gi18n.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-
-#include "gdm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "gdmconfig.h"
-
-static GSList *xservers = NULL;
-static const char *send_command = NULL;
-static const char *server = NULL;
-static const char *chosen_server = NULL;
-static char *auth_cookie = NULL;
-static gboolean got_standard = FALSE;
-static gboolean use_xnest = FALSE;
-static gboolean debug_in = FALSE;
-static gboolean authenticate = FALSE;
-static gboolean no_lock = FALSE;
-static gboolean monte_carlo_pi = FALSE;
-static gboolean startnew = FALSE;
-static gchar **args_remaining = NULL;
-
-GOptionEntry options [] = {
- { "command", 'c', 0, G_OPTION_ARG_STRING, &send_command, N_("Send the specified protocol command to GDM"), N_("COMMAND") },
- { "xnest", 'n', 0, G_OPTION_ARG_NONE, &use_xnest, N_("Xnest mode"), NULL },
- { "no-lock", 'l', 0, G_OPTION_ARG_NONE, &no_lock, N_("Do not lock current screen"), NULL },
- { "debug", 'd', 0, G_OPTION_ARG_NONE, &debug_in, N_("Debugging output"), NULL },
- { "authenticate", 'a', 0, G_OPTION_ARG_NONE, &authenticate, N_("Authenticate before running --command"), NULL },
- { "startnew", 's', 0, G_OPTION_ARG_NONE, &startnew, N_("Start new flexible session; do not show popup"), NULL },
- { "monte-carlo-pi", 0, 0, G_OPTION_ARG_NONE, &monte_carlo_pi, NULL, NULL },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &args_remaining, NULL, NULL },
- { NULL }
-};
-
-static int
-get_cur_vt (void)
-{
- char *ret;
- static int cur_vt;
- static gboolean checked = FALSE;
-
- if (checked)
- return cur_vt;
-
- ret = gdmcomm_call_gdm ("QUERY_VT", auth_cookie, "2.5.90.0", 5);
- if (ve_string_empty (ret) ||
- strncmp (ret, "OK ", 3) != 0) {
- g_free (ret);
- return -1;
- }
-
- if (sscanf (ret, "OK %d", &cur_vt) != 1)
- cur_vt = -1;
- g_free (ret);
- checked = TRUE;
- return cur_vt;
-}
-
-/* change to an existing vt */
-static void
-change_vt (int vt)
-{
- char *cmd;
- char *ret;
- cmd = g_strdup_printf (GDM_SUP_SET_VT " %d", vt);
- ret = gdmcomm_call_gdm (cmd, auth_cookie, "2.5.90.0", 5);
- g_free (cmd);
- if (ve_string_empty (ret) ||
- strcmp (ret, "OK") != 0) {
- GtkWidget *dialog;
- const char *message = gdmcomm_get_error_message (ret, use_xnest);
-
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot change display"),
- message);
-
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
- g_free (ret);
-}
-
-static int
-get_vt_num (char **vec, char *vtpart, int depth)
-{
- int i;
-
- if (ve_string_empty (vtpart) || depth <= 0)
- return -1;
-
- if (strchr (vtpart, ':') == NULL)
- return atoi (vtpart);
-
- for (i = 0; vec[i] != NULL; i++) {
- char **rvec;
- rvec = g_strsplit (vec[i], ",", -1);
- if (rvec == NULL ||
- ve_vector_len (rvec) != 3)
- continue;
-
- if (strcmp (rvec[0], vtpart) == 0) {
- /* could be nested? */
- int r = get_vt_num (vec, rvec[2], depth-1);
- g_strfreev (rvec);
- return r;
-
- }
-
- g_strfreev (rvec);
- }
- return -1;
-}
-
-enum {
- COLUMN_LOGIN /* human string */,
- COLUMN_DISPLAY /* human string */,
- COLUMN_VT /* vt number */,
- COLUMN_NUM
-};
-
-static GtkTreeModel *
-create_model (char **vec)
-{
- int i;
- GtkListStore *store;
- GtkTreeIter iter;
-
- /* create list store */
- store = gtk_list_store_new (COLUMN_NUM,
- G_TYPE_STRING /* login */,
- G_TYPE_STRING /* display */,
- G_TYPE_INT /* vt */);
-
- for (i = 0; vec[i] != NULL; i++) {
- char **rvec;
- int vt;
- rvec = g_strsplit (vec[i], ",", -1);
- if (rvec == NULL ||
- ve_vector_len (rvec) != 3)
- continue;
-
- vt = get_vt_num (vec, rvec[2], 5);
-
- if (strcmp (rvec[0], gdmcomm_get_display ()) != 0 &&
- vt >= 0) {
- char *user;
- char *disp;
-
- if (ve_string_empty (rvec[1])) {
- user = g_strdup (_("Nobody"));
- } else {
- struct passwd *pw = getpwnam (rvec[1]);
- if (pw == NULL ||
- ve_string_empty (pw->pw_gecos)) {
- char *login;
- login = g_markup_escape_text (rvec[1], -1);
-
- user = g_strdup_printf ("<b>%s</b>",
- login);
-
- g_free (login);
- } else {
- char *utf8gecos;
- char *gecos, *login;
- login = g_markup_escape_text (rvec[1], -1);
- if ( ! g_utf8_validate (pw->pw_gecos, -1, NULL))
- utf8gecos = ve_locale_to_utf8 (pw->pw_gecos);
- else
- utf8gecos = g_strdup (pw->pw_gecos);
-
- gecos = g_markup_escape_text (utf8gecos, -1);
-
- user = g_strdup_printf ("<b>%s</b>\n%s",
- login,
- gecos);
-
- g_free (login);
- g_free (gecos);
- g_free (utf8gecos);
- }
- }
-
- if (strchr (rvec[2], ':') == NULL) {
- disp = g_strdup_printf
- (_("Display %s on virtual "
- "terminal %d"),
- rvec[0], vt);
- } else {
- disp = g_strdup_printf
- (_("Nested display %s on virtual "
- "terminal %d"),
- rvec[0], vt);
- }
-
- /* this is not the current display */
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- COLUMN_LOGIN, user,
- COLUMN_DISPLAY, disp,
- COLUMN_VT, vt,
- -1);
-
- g_free (user);
- g_free (disp);
- }
-
- g_strfreev (rvec);
- }
-
- return GTK_TREE_MODEL (store);
-}
-
-static void
-add_columns (GtkTreeView *treeview)
-{
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
-
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Username"),
- renderer,
- "markup",
- COLUMN_LOGIN,
- NULL);
- gtk_tree_view_column_set_sort_column_id (column, COLUMN_LOGIN);
- gtk_tree_view_append_column (treeview, column);
-
- renderer = gtk_cell_renderer_text_new ();
- column = gtk_tree_view_column_new_with_attributes (_("Display"),
- renderer,
- "text",
- COLUMN_DISPLAY,
- NULL);
- gtk_tree_view_column_set_sort_column_id (column, COLUMN_DISPLAY);
- gtk_tree_view_append_column (treeview, column);
-}
-
-enum {
- RESPONSE_OPEN_NEW_DISPLAY,
- RESPONSE_OPEN_EXISTING_DISPLAY
-};
-
-static void
-selection_changed (GtkTreeSelection *selection, gpointer data)
-{
- GtkWidget *dialog = data;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
- RESPONSE_OPEN_EXISTING_DISPLAY,
- TRUE);
- } else {
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
- RESPONSE_OPEN_EXISTING_DISPLAY,
- FALSE);
- }
-}
-
-static void
-row_activated (GtkTreeView *view, GtkTreePath *path, GtkTreeViewColumn *col, gpointer data)
-{
- GtkWidget *dialog = data;
- GtkTreeSelection *selection;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
- gtk_tree_selection_select_path (selection, path);
- gtk_dialog_response (GTK_DIALOG (dialog), RESPONSE_OPEN_EXISTING_DISPLAY);
-}
-
-static gboolean
-is_program_in_path (const char *program)
-{
- char *tmp = g_find_program_in_path (program);
- if (tmp != NULL) {
- g_free (tmp);
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-static void
-maybe_lock_screen (void)
-{
- gboolean use_gscreensaver = FALSE;
- GError *error = NULL;
- char *command;
- GdkScreen *screen;
-
- if (is_program_in_path ("gnome-screensaver-command"))
- use_gscreensaver = TRUE;
- else if (! is_program_in_path ("xscreensaver-command"))
- return;
-
- if (use_gscreensaver) {
- command = g_strdup ("gnome-screensaver-command --lock");
- } else {
- command = g_strdup ("xscreensaver-command -lock");
- }
-
- screen = gdk_screen_get_default ();
-
- if (! gdk_spawn_command_line_on_screen (screen, command, &error)) {
- g_warning ("Cannot lock screen: %s", error->message);
- g_error_free (error);
- }
-
- g_free (command);
-
- if (use_gscreensaver) {
- command = g_strdup ("gnome-screensaver-command --throttle");
- } else {
- command = g_strdup ("xscreensaver-command -throttle");
- }
-
- if (! gdk_spawn_command_line_on_screen (screen, command, &error)) {
- g_warning ("Cannot disable screensaver engines: %s", error->message);
- g_error_free (error);
- }
-
- g_free (command);
-}
-
-static void
-run_logged_in_dialogue (char **vec)
-{
- GtkWidget *dialog;
- GtkWidget *vbox;
- GtkWidget *w;
- GtkWidget *sw;
- GtkTreeModel *model;
- GtkWidget *treeview;
- GtkTreeIter iter;
- GtkTreeSelection *selection;
- gint response;
-
- if (startnew == TRUE) {
- /* Just return if the user doesn't want to see the dialog */
- return;
- }
-
- dialog = gtk_dialog_new_with_buttons (_("Open Displays"),
- NULL /* parent */,
- 0 /* flags */,
- _("_Open New Display"),
- RESPONSE_OPEN_NEW_DISPLAY,
- _("Change to _Existing Display"),
- RESPONSE_OPEN_EXISTING_DISPLAY,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL,
- NULL);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- vbox = GTK_DIALOG (dialog)->vbox;
-
- w = gtk_label_new (_("There are some displays already open. You can select "
- "one from the list below or open a new one."));
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
- GTK_SHADOW_ETCHED_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- gtk_box_pack_start (GTK_BOX (vbox), sw, TRUE, TRUE, 0);
-
- /* create tree model */
- model = create_model (vec);
-
- /* create tree view */
- treeview = gtk_tree_view_new_with_model (model);
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
-
- g_object_unref (model);
-
- gtk_container_add (GTK_CONTAINER (sw), treeview);
-
- /* add columns to the tree view */
- add_columns (GTK_TREE_VIEW (treeview));
-
- /* finish & show */
- gtk_window_set_default_size (GTK_WINDOW (dialog), 280, 250);
-
- g_signal_connect (G_OBJECT (treeview), "row_activated",
- G_CALLBACK (row_activated),
- dialog);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
-
- g_signal_connect (selection, "changed",
- G_CALLBACK (selection_changed),
- dialog);
-
- gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog),
- RESPONSE_OPEN_EXISTING_DISPLAY,
- FALSE);
-
- gtk_widget_show_all (dialog);
- response = gtk_dialog_run (GTK_DIALOG (dialog));
-
-run_again:
- switch (response) {
- case RESPONSE_OPEN_NEW_DISPLAY:
- gtk_widget_destroy (dialog);
-
- /* just continue what you are doing */
- return;
-
- case RESPONSE_OPEN_EXISTING_DISPLAY:
- if (gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- GValue value = {0};
- int vt;
- gtk_tree_model_get_value (model, &iter,
- COLUMN_VT,
- &value);
- vt = g_value_get_int (&value);
- g_value_unset (&value);
-
- /* we switched to a different screen as a result of this,
- * lock the current screen */
- if ( ! no_lock && vt != get_cur_vt () && vt >= 0) {
- maybe_lock_screen ();
- }
-
- change_vt (vt);
-
- /* FIXME: wait + disturb the pointer (need SUP?),
- * perhaps part of the sup command to CHVT ?? */
-
- exit (0);
- } else {
- /* EEK */
- goto run_again;
- }
- break;
-
- default:
- gtk_widget_destroy (dialog);
- /* cancel, or close */
- exit (0);
- break;
- }
-}
-
-static void
-check_for_users (void)
-{
- char *ret;
- char **vec;
- int i;
- int extra;
-
- /* only for console logins on vt supporting systems */
- if (auth_cookie == NULL ||
- get_cur_vt () < 0)
- return;
-
- ret = gdmcomm_call_gdm ("CONSOLE_SERVERS", auth_cookie, "2.2.4.0", 5);
- if (ve_string_empty (ret) ||
- strncmp (ret, "OK ", 3) != 0) {
- g_free (ret);
- return;
- }
-
- vec = g_strsplit (&ret[3], ";", -1);
- g_free (ret);
- if (vec == NULL)
- return;
-
- extra = 0;
-
- for (i = 0; vec[i] != NULL; i++) {
- char **rvec;
- int vt;
- rvec = g_strsplit (vec[i], ",", -1);
- if (rvec == NULL ||
- ve_vector_len (rvec) != 3)
- continue;
-
- vt = get_vt_num (vec, rvec[2], 5);
-
- if (strcmp (rvec[0], gdmcomm_get_display ()) != 0 &&
- vt >= 0) {
- /* this is not the current display */
- extra++;
- }
-
- g_strfreev (rvec);
- }
-
- if (extra == 0) {
- g_strfreev (vec);
- return;
- }
-
- run_logged_in_dialogue (vec);
-
- g_strfreev (vec);
-}
-
-static void
-read_servers (void)
-{
- GSList *li;
-
- xservers = gdm_config_get_xservers (TRUE);
-
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
-
- if (strcmp (svr->id, GDM_STANDARD) == 0)
- got_standard = TRUE;
-
- if (server != NULL &&
- strcmp (svr->id, server) == 0)
- chosen_server = g_strdup (svr->id);
- }
-}
-
-static char *
-choose_server (void)
-{
- GtkWidget *dialog, *vbox;
- GtkWidget *w;
- GSList *group = NULL;
- GSList *li;
-
- if (chosen_server != NULL)
- return g_strdup (chosen_server);
-
- if (xservers == NULL)
- return NULL;
-
- if (xservers->next == NULL &&
- got_standard)
- return g_strdup (GDM_STANDARD);
-
- dialog = gtk_dialog_new_with_buttons (_("Choose server"),
- NULL /* parent */,
- 0 /* flags */,
- GTK_STOCK_OK,
- GTK_RESPONSE_OK,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL,
- NULL);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- vbox = GTK_DIALOG (dialog)->vbox;
-
- w = gtk_label_new (_("Choose the X server to start"));
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
-
- group = NULL;
- if ( ! got_standard) {
- w = gtk_radio_button_new_with_label (group,
- _("Standard server"));
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), TRUE);
- group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- }
-
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
- w = gtk_radio_button_new_with_label
- (group, svr->name ? svr->name : svr->id);
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE, 0);
- if (got_standard &&
- strcmp (svr->id, GDM_STANDARD) == 0)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
- TRUE);
- g_object_set_data (G_OBJECT (w), "ServerID", svr->id);
- group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- }
-
- gtk_widget_show_all (dialog);
-
- switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
- case GTK_RESPONSE_OK:
- /* OK */
- break;
- default:
- gtk_widget_destroy (dialog);
- /* cancel, or close */
- exit (0);
- break;
- }
-
- for (li = group; li != NULL; li = li->next) {
- GtkWidget *w = li->data;
- char *name = g_object_get_data (G_OBJECT (w), "ServerID");
- if (GTK_TOGGLE_BUTTON (w)->active) {
- gtk_widget_destroy (dialog);
- return g_strdup (name);
- }
- }
-
- gtk_widget_destroy (dialog);
-
- /* should never get here really */
- return NULL;
-}
-
-/**
- * is_key
- *
- * Since GDM keys sometimes have default values defined in the gdm.h header
- * file (e.g. key=value), this function strips off the "=value" from both
- * keys passed in to do a comparison.
- */
-static gboolean
-is_key (const gchar *key1, const gchar *key2)
-{
- gchar *key1d, *key2d, *p;
-
- key1d = g_strdup (key1);
- key2d = g_strdup (key2);
-
- g_strstrip (key1d);
- p = strchr (key1d, '=');
- if (p != NULL)
- *p = '\0';
-
- g_strstrip (key2d);
- p = strchr (key2d, '=');
- if (p != NULL)
- *p = '\0';
-
- if (strcmp (key1d, key2d) == 0) {
- g_free (key1d);
- g_free (key2d);
- return TRUE;
- } else {
- g_free (key1d);
- g_free (key2d);
- return FALSE;
- }
-}
-
-static void
-calc_pi (void)
-{
- unsigned long n = 0, h = 0;
- double x, y;
- printf ("\n");
- for (;;) {
- x = g_random_double ();
- y = g_random_double ();
- if (x*x + y*y <= 1)
- h++;
- n++;
- if ( ! (n & 0xfff))
- printf ("pi ~~ %1.10f\t(%lu/%lu * 4) iteration: %lu \r",
- ((double)h)/(double)n * 4.0, h, n, n);
- }
-}
-
-
-int
-main (int argc, char *argv[])
-{
- GtkWidget *dialog;
- char *command;
- char *version;
- char *ret;
- const char *message;
- GOptionContext *ctx;
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- /* Option parsing */
- ctx = g_option_context_new("- New gdm login");
- g_option_context_add_main_entries(ctx, options, _("main options"));
- g_option_context_parse(ctx, &argc, &argv, NULL);
- g_option_context_free(ctx);
-
- if (monte_carlo_pi) {
- calc_pi ();
- return 0;
- }
-
- gdmcomm_set_debug (debug_in);
-
- if (args_remaining != NULL && args_remaining[0] != NULL)
- server = args_remaining[0];
-
- if ( ! gdmcomm_check (FALSE)) {
- gdm_common_error ("Error: GDM (GNOME Display Manager) is not "
- "running.");
- gdm_common_error ("You might be using a different display "
- "manager.");
- return 1;
- }
-
- /* Start reading config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- /* Process --command option */
-
- g_type_init ();
-
- if (send_command != NULL) {
- if (authenticate)
- auth_cookie = gdmcomm_get_auth_cookie ();
-
- /*
- * If asking for a translatable config value, then try to get
- * the translated value first. If this fails, then go ahead
- * and call the normal sockets command.
- */
- if (strncmp (send_command, GDM_SUP_GET_CONFIG " ",
- strlen (GDM_SUP_GET_CONFIG " ")) == 0) {
- gchar *value = NULL;
- const char *key = &send_command[strlen (GDM_SUP_GET_CONFIG " ")];
-
- if (is_key (GDM_KEY_WELCOME, key) ||
- is_key (GDM_KEY_REMOTE_WELCOME, key)) {
- value = gdm_config_get_translated_string ((gchar *)key);
- if (value != NULL) {
- ret = g_strdup_printf ("OK %s", value);
- }
- }
-
- /*
- * If the above didn't return a value, then must be a
- * different key, so call gdmcomm_call_gdm.
- */
- if (value == NULL)
- ret = gdmcomm_call_gdm (send_command, auth_cookie,
- "2.2.4.0", 5);
- } else {
- ret = gdmcomm_call_gdm (send_command, auth_cookie,
- "2.2.4.0", 5);
- }
-
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
-
- if (ret != NULL) {
- g_print ("%s\n", ret);
- return 0;
- } else {
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot communicate with GDM "
- "(The GNOME Display Manager)"),
- _("Perhaps you have an old version "
- "of GDM running."));
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return 1;
- }
- }
-
- /*
- * The --command argument does not display anything, so avoid running
- * gtk_init until it finishes. Sometimes the --command argument is
- * used when there is no display so it will fail and cause the
- * program to exit, complaining about "no display".
- *
- * Now process what gdmflexiserver is more used to do, start a
- * VT virtual terminal sesions - at least on systems where it
- * works. On systems where it doesn't work VT stands for
- * "Very Tight" and will mess up your display if you try to
- * use it. Tight! So don't use it. I'd accept a patch to
- * disable it, but its easy to avoid not using it as long
- * as your distro doesn't put the menu choice in the
- * application launch button on the panel (don't ship the
- * desktop file).
- */
- gtk_init(&argc, &argv);
-
- /* always attempt to get cookie and authenticate. On remote
- servers */
- auth_cookie = gdmcomm_get_auth_cookie ();
-
- /* check for other displays/logged in users */
- check_for_users ();
-
- if (use_xnest) {
- char *cookie = gdmcomm_get_a_cookie (FALSE /* binary */);
-
- if (cookie == NULL) {
-
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
-
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("You do not seem to have the "
- "authentication needed for this "
- "operation"),
- _("Perhaps your .Xauthority "
- "file is not set up correctly."));
-
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return 1;
- }
- command = g_strdup_printf (GDM_SUP_FLEXI_XNEST " %s %d %s %s",
- gdmcomm_get_display (),
- (int)getuid (),
- cookie,
- XauFileName ());
- g_free (cookie);
- version = "2.3.90.4";
- auth_cookie = NULL;
- } else {
- if (auth_cookie == NULL) {
-
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
-
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("You do not seem to be logged in on the "
- "console"),
- _("Starting a new login only "
- "works correctly on the console."));
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog),
- FALSE);
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return 1;
- }
-
- read_servers ();
- server = choose_server ();
- if (server == NULL)
- command = g_strdup (GDM_SUP_FLEXI_XSERVER);
- else
- command = g_strdup_printf (GDM_SUP_FLEXI_XSERVER " %s",
- server);
- version = "2.2.4.0";
- }
-
- ret = gdmcomm_call_gdm (command, auth_cookie, version, 5);
- g_free (command);
-
- g_strfreev (args_remaining);
-
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
-
- if (ret != NULL &&
- strncmp (ret, "OK ", 3) == 0) {
-
- /* if we switched to a different screen as a result of this,
- * lock the current screen */
- if ( ! no_lock && ! use_xnest) {
- maybe_lock_screen ();
- }
-
- /* all fine and dandy */
- return 0;
- }
-
- message = gdmcomm_get_error_message (ret, use_xnest);
-
- dialog = ve_hig_dialog_new
- (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot start new display"),
- message);
-
- gtk_widget_show_all (dialog);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return 1;
-}
-
-/* Used for torture testing the socket */
-#if 0
-static void
-torture (void)
-{
- struct sockaddr_un addr;
- int fd;
- int i;
- int times;
-
- srand (getpid () * time (NULL));
-
- fd = socket (AF_UNIX, SOCK_STREAM, 0);
- if (fd < 0) {
- return;
- }
-
- strcpy (addr.sun_path, "/tmp/.gdm_socket");
- addr.sun_family = AF_UNIX;
-
- if (connect (fd, &addr, sizeof (addr)) < 0) {
- close (fd);
- return;
- }
-
- g_print ("OPEN ");
-
- times = rand () % 500;
- for (i = 0; i < rand () % 500; i++) {
- int len = rand () % 5000;
- char *buf = g_new (char, len);
- int ii;
- for (ii = 0; ii < len; ii++)
- buf[ii] = rand () % 256;
- write (fd, buf, len);
- g_free (buf);
- g_print ("SENT(%d) ", len);
- }
-
- close (fd);
-}
-
-static void
-torture_test (void)
-{
- int i;
-
- srand (getpid () * time (NULL));
-
- for (i = 0; i < 500; i++) {
- if (fork () == 0) {
- torture ();
- _exit (0);
- }
- usleep (1000);
- }
-}
-#endif
diff --git a/gui/gdmflexiserver.desktop.in b/gui/gdmflexiserver.desktop.in
deleted file mode 100644
index 8053f8a0..00000000
--- a/gui/gdmflexiserver.desktop.in
+++ /dev/null
@@ -1,13 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-_Name=New Login
-_GenericName=New Login
-_Comment=Log in as another user without logging out
-Exec=gdmflexiserver
-Icon=gdm
-Terminal=false
-Type=Application
-Categories=GNOME;GTK;System;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gdm
-X-GNOME-Bugzilla-Component=general
diff --git a/gui/gdmlanguages.c b/gui/gdmlanguages.c
deleted file mode 100644
index 98d2fdcf..00000000
--- a/gui/gdmlanguages.c
+++ /dev/null
@@ -1,649 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2001 George Lebl
- *
- * 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 "config.h"
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <locale.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "gdmlanguages.h"
-#include "gdmconfig.h"
-
-typedef struct _Language Language;
-struct _Language {
- char *name;
- char *code;
- char *untranslated;
- int found;
-
- /* extra fields */
- char *collate_key;
-};
-
-/* FIXME: We need to have a nicer selection of language and country,
- * I suppose that we should have a menu of languages and then for each have
- * a submenu of countries (and perhaps other variations such as utf8 vs not
- * etc...) if there is more then one. */
-
-/* Note: these should NOT include the encodings, this is just a translation
- * matrix for language_country names. This is NOT a list of available
- * languages, just their names and where they are placed in the menu.
- * The available languages come from the supplied locale.alias */
-static Language languages [] = {
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Afrikaans"), "af_ZA", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Albanian"), "sq_AL", "Shqip", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Amharic"), "am_ET", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Arabic (Egypt)"), "ar_EG", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Arabic (Lebanon)"), "ar_LB", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Arabic (Saudi Arabia)"), "ar_SA", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Armenian"), "hy_AM", "Հայերեն", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Azerbaijani"), "az_AZ", "Azərbaycanca", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Basque"), "eu_ES", "Euskara", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Belarusian"), "be_BY", "Беларуская мова", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Bengali"), "bn_BD", "বাংলা", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Bengali (India)"), "bn_IN", "বাংলা", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Bulgarian"), "bg_BG", "Български", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Bosnian"), "bs_BA", "Bosanski", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Catalan"), "ca_ES", "Català", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Chinese (China Mainland)"), "zh_CN", "中文 (中国大陆)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Chinese (Hong Kong)"), "zh_HK", "中文 (香港)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Chinese (Singapore)"), "zh_SG", "中文 (新加坡)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Chinese (Taiwan)"), "zh_TW", "中文 (台灣)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Croatian"), "hr_HR", "Hrvatski", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Czech"), "cs_CZ", "čeština", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Danish"), "da_DK", "dansk", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Dutch"), "nl_NL", "Nederlands", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Dutch (Belgium)"), "nl_BE", "Nederlands (België)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (USA)"), "en_US", "American English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Australia)"), "en_AU", "Australian English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (UK)"), "en_GB", "British English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Canada)"), "en_CA", "Canadian English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Ireland)"), "en_IE", "Irish English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Denmark)"), "en_DK", "Danish English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (South Africa)"), "en_ZA", "South African English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (Malta)"), "en_MT", "Maltese English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|English (New Zealand)"), "en_NZ", "New Zealand English", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Estonian"), "et_EE", "Eesti", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Finnish"), "fi_FI", "Suomi", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|French"), "fr_FR", "Français", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|French (Belgium)"), "fr_BE", "Français (Belgique)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|French (Canada)"), "fr_CA", "Français (Canada)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|French (Luxembourg)"), "fr_LU", "Français (Luxembourg)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|French (Switzerland)"), "fr_CH", "Français (Suisse)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Galician"), "gl_ES", "Galego", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|German"), "de_DE", "Deutsch", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|German (Austria)"), "de_AT", "Deutsch (Österreich)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|German (Luxembourg)"), "de_LU", "Deutsch (Luxemburg)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|German (Switzerland)"), "de_CH", "Deutsch (Schweiz)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Greek"), "el_GR", "Ελληνικά", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Greek (Cyprus)"), "el_CY", "Ελληνικά (Κύπρος)", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Gujarati"), "gu_IN", "ગુજરાતી", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Hebrew"), "he_IL", "עברית", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Hebrew"), "iw_IL", "עברית", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Hindi"), "hi_IN", "हिंदी", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Hungarian"), "hu_HU", "Magyar", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Icelandic"), "is_IS", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Indonesian"), "id_ID", "Bahasa Indonesia", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Interlingua"), "ia", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Irish"), "ga_IE", "Gaeilge", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Italian"), "it_IT", "Italiano", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Japanese"), "ja_JP", "日本語", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Kannada"), "kn_IN", "ಕನ್ನಡ", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Kinyarwanda"), "rw_RW", "Kinyarwanda", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Korean"), "ko_KR", "한국어", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Latvian"), "lv_LV", "Latviešu", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Lithuanian"), "lt_LT", "Lietuvių", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Macedonian"), "mk_MK", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Malay"), "ms_MY", "Bahasa Melayu", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Malayalam"), "ml_IN", "മലയാളം", 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Maltese"), "mt_MT", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Marathi"), "mr_IN", NULL, 0 },
- /*Note translate the A-M to the A-M you used in the group label */
- { N_("A-M|Mongolian"), "mn_MN", "Монгол", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Northern Sotho"), "nso_ZA", "Sesotho sa Leboa", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Norwegian (bokmal)"), "no_NO", "Norsk (bokmål)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Norwegian (nynorsk)"), "nn_NO", "Norsk (nynorsk)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Oriya"), "or_IN", NULL, 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Punjabi"), "pa_IN", NULL, 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Persian"), "fa_IR", "فارسی", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Polish"), "pl_PL", "Polski", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Portuguese"), "pt_PT", "Português", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Portuguese (Brazilian)"), "pt_BR", "Português do Brasil", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Romanian"), "ro_RO", "Română", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Russian"), "ru_RU", "русский", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian"), "sr_YU", "српски", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Serbia & Montenegro)"), "sr_CS", "српски", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Montenegro)"), "sr_ME", "српски", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Serbia)"), "sr_RS", "српски", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Latin)"), "sr_CS@Latn", "srpski (latinica)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Jekavian)"), "sr_CS@ije", "српски (ијекавски)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Serbian (Bosnia)"), "sh_BA", "srpski (Bosna i Hercegovina)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Slovak"), "sk_SK", "Slovenský", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Slovenian"), "sl_SI", "Slovenščina", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish"), "es_ES", "Español", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Argentina)"), "es_AR", "Español (Argentina)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Bolivia)"), "es_BO", "Español (Bolivia)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Chile)"), "es_CL", "Español (Chile)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Colombia)"), "es_CO", "Español (Colombia)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Costa Rica)"), "es_CR", "Español (Costa Rica)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Ecuador)"), "es_EC", "Español (Ecuador)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Guatemala)"), "es_GT", "Español (Guatemala)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Mexico)"), "es_MX", "Español (México)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Nicaragua)"), "es_NI", "Español (Nicaragua)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Panama)"), "es_PA", "Español (Panamá)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Peru)"), "es_PE", "Español (Perú)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Paraguay)"), "es_PY", "Español (Paraguay)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (El Salvador)"), "es_SV", "Español (El Salvador)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Uruguay)"), "es_UY", "Español (Uruguay)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Spanish (Venezuela)"), "es_VE", "Español (Venezuela)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Swedish"), "sv_SE", "Svenska", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Swedish (Finland)"), "sv_FI", "Svenska (Finland)", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Tamil"), "ta_IN", NULL, 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Telugu"), "te_IN", NULL, 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Thai"), "th_TH", "ไทย", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Turkish"), "tr_TR", "Türkçe", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Ukrainian"), "uk_UA", "Українська", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Vietnamese"), "vi_VN", "Việt Nam", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Walloon"), "wa_BE", "Walon", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Welsh"), "cy_GB", "Cymraeg", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Xhosa"), "xh_ZA", "isiXhosa", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Yiddish"), "yi", "ייִדיש", 0 },
- /*Note translate the N-Z to the N-Z you used in the group label */
- { N_("N-Z|Zulu"), "zu_ZA", "isiZulu", 0 },
- /* This is the POSIX/C locale for english, should really be in Other */
- { N_("Other|POSIX/C English"), "C", "POSIX/C English", 0 },
- { NULL, NULL }
-};
-
-static GHashTable *lang_names = NULL;
-
-static void
-gdm_lang_init (void)
-{
- int i;
- if (lang_names != NULL)
- return;
-
- lang_names = g_hash_table_new (g_str_hash, g_str_equal);
-
- for (i = 0; languages[i].name != NULL; i++) {
- g_hash_table_insert (lang_names,
- languages[i].code,
- &languages[i]);
- }
-}
-
-static Language *
-find_lang (const char *language, gboolean *clean)
-{
- char *name, *p;
- Language *lang;
-
- *clean = FALSE;
-
- lang = g_hash_table_lookup (lang_names, language);
- if (lang != NULL) {
- *clean = TRUE;
- return lang;
- }
-
- name = g_strdup (language);
-
- p = strrchr (name, '@');
- if (p != NULL) {
- char *mod = p+1;
- *p = '\0';
-
- /* attempt lookup without encoding but with the
- modifier first */
- p = strrchr (name, '.');
- if (p != NULL) {
- char *noenc;
- *p = '\0';
-
- noenc = g_strconcat (name, "@", mod, NULL);
- lang = g_hash_table_lookup (lang_names, noenc);
- if (lang != NULL) {
- g_free (name);
- g_free (noenc);
- return lang;
- }
- g_free (noenc);
-
- *p = '.';
- }
-
- lang = g_hash_table_lookup (lang_names, name);
- if (lang != NULL) {
- g_free (name);
- return lang;
- }
- }
-
- p = strrchr (name, '.');
- if (p != NULL) {
- *p = '\0';
- lang = g_hash_table_lookup (lang_names, name);
- if (lang != NULL) {
- g_free (name);
- return lang;
- }
- }
-
- p = strrchr (name, '_');
- if (p != NULL) {
- *p = '\0';
- lang = g_hash_table_lookup (lang_names, name);
- if (lang != NULL) {
- g_free (name);
- return lang;
- }
- }
-
- g_free (name);
- return NULL;
-}
-
-gboolean
-gdm_lang_name_translated (const char *language)
-{
- Language *lang;
- gboolean clean;
-
- gdm_lang_init ();
-
- lang = find_lang (language, &clean);
- if (lang == NULL)
- return FALSE;
-
- if (strcmp (lang->name, _(lang->name)) == 0)
- return FALSE;
-
- return TRUE;
-}
-
-char *
-gdm_lang_name (const char *language,
- gboolean never_encoding,
- gboolean no_group,
- gboolean untranslated,
- gboolean markup)
-{
- Language *lang;
- char *name;
- gboolean clean;
- const char *encoding;
-
- gdm_lang_init ();
-
- lang = find_lang (language, &clean);
- if (lang == NULL)
- return g_strdup (language);
-
- encoding = strchr (language, '.');
- if (encoding == NULL)
- encoding = strchr (language, '@'); /* treat a modifier without a codeset as an encoding */
- if (encoding != NULL)
- encoding++;
-
- /* if more then one language in the language file with this
- * locale, then hell, include the encoding to differentiate them */
- if (lang->found > 1 &&
- encoding != NULL &&
- ! never_encoding)
- name = g_strdup_printf ("%s (%s)", _(lang->name), encoding);
- else
- name = g_strdup (_(lang->name));
-
- if (lang->untranslated != NULL && untranslated) {
- char *full;
- full = g_strdup_printf ("%s (%s)",
- name, lang->untranslated);
- g_free (name);
- name = full;
- }
-
- if (no_group) {
- char *p = strchr (name, '|');
- if (p != NULL) {
- p = g_strdup (p + 1);
- g_free (name);
- name = p;
- }
- }
-
- return name;
-}
-
-/* NULL if not found */
-char *
-gdm_lang_untranslated_name (const char *language,
- gboolean markup)
-{
- Language *lang;
- gboolean clean;
-
- gdm_lang_init ();
-
- lang = find_lang (language, &clean);
- if (lang == NULL)
- return NULL;
-
- return g_strdup (lang->untranslated);
-}
-
-const char *
-gdm_lang_group1 (void)
-{
- /* This should be the same as in the front of the language strings
- * else the languages will appear in the "Other" submenu */
- return _("A-M");
-}
-
-const char *
-gdm_lang_group2 (void)
-{
- /* This should be the same as in the front of the language strings
- * else the languages will appear in the "Other" submenu */
- return _("N-Z");
-}
-
-static int
-lang_collate (gconstpointer a, gconstpointer b)
-{
- gboolean clean;
- Language *l1 = find_lang ((const char *)a, &clean);
- Language *l2 = find_lang ((const char *)b, &clean);
-
- /* paranoia */
- if (l1 == NULL || l2 == NULL)
- return 0;
-
- if (l1->collate_key == NULL) {
- const char *name;
- name = strchr (_(l1->name), '|');
- if (name != NULL)
- name++;
- else
- name = _(l1->name);
- l1->collate_key = g_utf8_collate_key (name, -1);
- }
-
- if (l2->collate_key == NULL) {
- const char *name;
- name = strchr (_(l2->name), '|');
- if (name != NULL)
- name++;
- else
- name = _(l2->name);
- l2->collate_key = g_utf8_collate_key (name, -1);
- }
-
- return strcmp (l1->collate_key, l2->collate_key);
-}
-
-GList *
-gdm_lang_read_locale_file (const char *locale_file)
-{
- FILE *langlist;
- char curline[256];
- GList *langs = NULL;
- GHashTable *dupcheck;
- gboolean got_english = FALSE;
- Language *language;
- gboolean clean;
- char *curlocale;
- char *getsret;
- char *p;
-
- if (locale_file == NULL)
- return NULL;
-
- VE_IGNORE_EINTR (langlist = fopen (locale_file, "r"));
-
- if (langlist == NULL)
- return NULL;
-
- gdm_lang_init ();
-
- dupcheck = g_hash_table_new (g_str_hash, g_str_equal);
-
- for (;;) {
- char *name;
- char *lang;
- char **lang_list;
- int i;
-
- VE_IGNORE_EINTR (getsret = fgets (curline, sizeof (curline), langlist));
- if (getsret == NULL)
- break;
-
- if (curline[0] <= ' ' ||
- curline[0] == '#')
- continue;
-
- name = strtok (curline, " \t\r\n");
- if (name == NULL)
- continue;
-
- lang = strtok (NULL, " \t\r\n");
- if (lang == NULL)
- continue;
-
- lang_list = g_strsplit (lang, ",", -1);
- if (lang_list == NULL)
- continue;
-
- lang = NULL;
- for (i = 0; lang_list[i] != NULL; i++) {
- if (ve_locale_exists (lang_list[i])) {
- lang = lang_list[i];
- break;
- }
- }
- if (lang == NULL ||
- g_hash_table_lookup (dupcheck, lang) != NULL) {
- g_strfreev (lang_list);
- continue;
- }
- language = find_lang (lang, &clean);
-
- if (language != NULL) {
- language->found++;
- } else {
- language = g_new0 (Language, 1);
- language->found = 1;
- /* add a space before an open bracket to match
- the style used in the internal list.
- e.g. change "English(India)" to "English (India)" */
- p = strchr (name, '(');
- if (p != NULL && p > name && *(p-1) != ' ') {
- *p = 0;
- language->name= g_strconcat (name, " (", p+1, NULL);
- } else
- language->name = g_strdup (name);
- /* only store the "lang_country" part of the locale code, so that we notice
- * if there is more than one encoding of this language. See bug 132629. */
- p = strchr (lang, '.');
- if (p == NULL)
- p = strchr (lang, '@');
- if (p != NULL)
- language->code = g_strndup (lang, (p - lang));
- else
- language->code = g_strdup (lang);
- language->untranslated = NULL;
- g_hash_table_insert (lang_names,
- language->code,
- language);
- }
-
- langs = g_list_prepend (langs, g_strdup (lang));
- g_hash_table_insert (dupcheck, g_strdup (lang),
- GINT_TO_POINTER (1));
-
- /* if we have an english locale */
- if (strncmp (lang, "en_", 3) == 0 ||
- strcmp (lang, "C") == 0)
- got_english = TRUE;
-
- g_strfreev (lang_list);
- }
-
- g_hash_table_foreach (dupcheck, (GHFunc) g_free, NULL);
- g_hash_table_destroy (dupcheck);
-
- /* If we haven't found any english locale, add american
- * english as that's as much of a fallback as we can get */
- if ( ! got_english)
- langs = g_list_prepend (langs, g_strdup ("en_US"));
-
- curlocale = setlocale (LC_MESSAGES, NULL);
- if (curlocale != NULL &&
- strcmp (curlocale, "C") != 0 &&
- find_lang (curlocale, &clean) == NULL) {
- langs = g_list_prepend (langs, g_strdup (curlocale));
- }
-
- langs = g_list_sort (langs, lang_collate);
-
- VE_IGNORE_EINTR (fclose (langlist));
-
- return langs;
-}
-
-/* EOF */
diff --git a/gui/gdmlanguages.h b/gui/gdmlanguages.h
deleted file mode 100644
index 240e30bc..00000000
--- a/gui/gdmlanguages.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2001 George Lebl
- *
- * 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 GDM_LANGUAGES_H
-#define GDM_LANGUAGES_H
-
-/* This is the interface for translating languages. Language translations
- * are now hardocded in, but that may change */
-
-const char * gdm_lang_group1 (void);
-const char * gdm_lang_group2 (void);
-
-char * gdm_lang_name (const char *language,
- gboolean never_encoding,
- gboolean no_group,
- gboolean untranslated,
- gboolean markup);
-gboolean gdm_lang_name_translated (const char *language);
-
-/* NULL if not found */
-char * gdm_lang_untranslated_name (const char *language,
- gboolean markup);
-
-GList * gdm_lang_read_locale_file (const char *file);
-
-#endif /* GDM_LANGUAGES_H */
-
-/* EOF */
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
deleted file mode 100644
index 9504088a..00000000
--- a/gui/gdmlogin.c
+++ /dev/null
@@ -1,3796 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <signal.h>
-#include <dirent.h>
-#include <locale.h>
-#include <pwd.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/XKBlib.h>
-
-#include <glib/gi18n.h>
-#include <gdk/gdkx.h>
-#include <gdk/gdkkeysyms.h>
-
-#if HAVE_PAM
-#include <security/pam_appl.h>
-#define PW_ENTRY_SIZE PAM_MAX_RESP_SIZE
-#else
-#define PW_ENTRY_SIZE GDM_MAX_PASS
-#endif
-
-#include "vicious.h"
-
-#include "gdm.h"
-#include "gdmuser.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmsession.h"
-#include "gdmwm.h"
-#include "gdmlanguages.h"
-#include "gdmconfig.h"
-#include "misc.h"
-
-/* set the DOING_GDM_DEVELOPMENT env variable if you aren't running
- * within the protocol */
-static gboolean DOING_GDM_DEVELOPMENT = FALSE;
-static gboolean browser_ok = TRUE;
-static gboolean disable_sys_config_chooser_buttons = FALSE;
-static gboolean GdmLockPosition = FALSE;
-static gboolean GdmSetPosition = FALSE;
-static gint GdmPositionX;
-static gint GdmPositionY;
-
-#define LAST_LANGUAGE "Last"
-#define DEFAULT_LANGUAGE "Default"
-#define GTK_KEY "gtk-2.0"
-
-enum {
- GREETER_ULIST_ICON_COLUMN = 0,
- GREETER_ULIST_LABEL_COLUMN,
- GREETER_ULIST_LOGIN_COLUMN
-};
-
-enum {
- GDM_BACKGROUND_NONE = 0,
- GDM_BACKGROUND_IMAGE_AND_COLOR = 1,
- GDM_BACKGROUND_COLOR = 2,
- GDM_BACKGROUND_IMAGE = 3,
-};
-
-static GtkWidget *login;
-static GtkWidget *logo_frame = NULL;
-static GtkWidget *logo_image = NULL;
-static GtkWidget *table = NULL;
-static GtkWidget *welcome;
-static GtkWidget *label;
-static GtkWidget *icon_button = NULL;
-static GtkWidget *title_box = NULL;
-static GtkWidget *clock_label = NULL;
-static GtkWidget *entry;
-static GtkWidget *ok_button;
-static GtkWidget *start_again_button;
-static GtkWidget *msg;
-static GtkWidget *auto_timed_msg;
-static GtkWidget *err_box;
-static guint err_box_clear_handler = 0;
-static gboolean require_quarter = FALSE;
-static GtkWidget *icon_win = NULL;
-static GtkWidget *sessmenu;
-static GtkWidget *langmenu;
-
-static gboolean login_is_local = FALSE;
-
-static GtkWidget *browser;
-static GtkTreeModel *browser_model;
-static GdkPixbuf *defface;
-
-/* Eew. Loads of global vars. It's hard to be event controlled while maintaining state */
-static GSList *languages = NULL;
-static GList *users = NULL;
-static GList *users_string = NULL;
-static gint size_of_users = 0;
-
-static const gchar *curlang = NULL;
-static gchar *curuser = NULL;
-static gchar *session = NULL;
-static gchar *language = NULL;
-
-static gint savelang = GTK_RESPONSE_NO;
-
-/* back_prog_timeout_event_id: event of the timer.
- * back_prog_watcher_event_id: event of the background program watcher.
- * back_prog_pid: process ID of the background program.
- * back_prog_has_run: true if the background program has run
- * at least once.
- * back_prog_watching_events: true if we are watching for user events.
- * back_prog_delayed: true if the execution of the program has
- * been delayed.
- */
-static gint back_prog_timeout_event_id = -1;
-static gint back_prog_watcher_event_id = -1;
-static gint back_prog_pid = -1;
-static gboolean back_prog_has_run = FALSE;
-static gboolean back_prog_watching_events = FALSE;
-static gboolean back_prog_delayed = FALSE;
-
-static guint timed_handler_id = 0;
-
-#if FIXME
-static char *selected_browser_user = NULL;
-#endif
-static gboolean selecting_user = TRUE;
-static gchar *selected_user = NULL;
-
-extern GList *sessions;
-extern GHashTable *sessnames;
-extern gchar *default_session;
-extern const gchar *current_session;
-extern gboolean session_dir_whacked_out;
-extern gint gdm_timed_delay;
-
-static gboolean first_prompt = TRUE;
-
-static void login_window_resize (gboolean force);
-
-/* Background program logic */
-static void back_prog_on_exit (GPid pid, gint status, gpointer data);
-static gboolean back_prog_on_timeout (gpointer data);
-static gboolean back_prog_delay_timeout (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data);
-static void back_prog_watch_events (void);
-static gchar * back_prog_get_path (void);
-static void back_prog_launch_after_timeout (void);
-static void back_prog_run (void);
-static void back_prog_stop (void);
-
-static void process_operation (guchar op_code, const gchar *args);
-
-/*
- * This function is called when the background program exits.
- * It will add a timer to restart the program after the
- * restart delay has elapsed, if this is enabled.
- */
-static void
-back_prog_on_exit (GPid pid, gint status, gpointer data)
-{
- g_assert (back_prog_timeout_event_id == -1);
-
- back_prog_watcher_event_id = -1;
- back_prog_pid = -1;
-
- back_prog_launch_after_timeout ();
-}
-
-/*
- * This function starts the background program (if any) when
- * the background program timer triggers, unless the execution
- * has been delayed.
- */
-static gboolean
-back_prog_on_timeout (gpointer data)
-{
- g_assert (back_prog_watcher_event_id == -1);
- g_assert (back_prog_pid == -1);
-
- back_prog_timeout_event_id = -1;
-
- if (back_prog_delayed) {
- back_prog_launch_after_timeout ();
- } else {
- back_prog_run ();
- }
-
- return FALSE;
-}
-
-/*
- * This function is called to delay the execution of the background
- * program when the user is doing something (when we detect an event).
- */
-static gboolean
-back_prog_delay_timeout (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- back_prog_delayed = TRUE;
- return TRUE;
-}
-
-/*
- * This function creates signal listeners to catch user events.
- * That allows us to avoid spawning the background program
- * when the user is doing something.
- */
-static void
-back_prog_watch_events (void)
- {
- guint sid;
-
- if (back_prog_watching_events)
- return;
-
- back_prog_watching_events = TRUE;
-
- sid = g_signal_lookup ("activate", GTK_TYPE_MENU_ITEM);
- g_signal_add_emission_hook (sid, 0, back_prog_delay_timeout,
- NULL, NULL);
-
- sid = g_signal_lookup ("key_release_event", GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid, 0, back_prog_delay_timeout,
- NULL, NULL);
-
- sid = g_signal_lookup ("button_press_event", GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid, 0, back_prog_delay_timeout,
- NULL, NULL);
- }
-
-/*
- * This function returns the path of the background program
- * if there is one. Otherwise, NULL is returned.
- */
-static gchar *
-back_prog_get_path (void)
-{
- gchar *backprog = gdm_config_get_string (GDM_KEY_BACKGROUND_PROGRAM);
-
- if ((gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE) == GDM_BACKGROUND_NONE ||
- gdm_config_get_bool (GDM_KEY_RUN_BACKGROUND_PROGRAM_ALWAYS)) &&
- ! ve_string_empty (backprog)) {
- return backprog;
- } else
- return NULL;
-}
-
-/*
- * This function creates a timer to start the background
- * program after the requested delay (in seconds) has elapsed.
- */
-static void
-back_prog_launch_after_timeout ()
-{
- int timeout;
-
- g_assert (back_prog_timeout_event_id == -1);
- g_assert (back_prog_watcher_event_id == -1);
- g_assert (back_prog_pid == -1);
-
- /* No program to run. */
- if (! back_prog_get_path ())
- return;
-
- /* First time. */
- if (! back_prog_has_run) {
- timeout = gdm_config_get_int (GDM_KEY_BACKGROUND_PROGRAM_INITIAL_DELAY);
-
- /* Already run, but we are allowed to restart it. */
- } else if (gdm_config_get_bool (GDM_KEY_RESTART_BACKGROUND_PROGRAM)) {
- timeout = gdm_config_get_int (GDM_KEY_BACKGROUND_PROGRAM_RESTART_DELAY);
-
- /* Already run, but we are not allowed to restart it. */
- } else {
- return;
- }
-
- back_prog_delayed = FALSE;
- back_prog_watch_events ();
- back_prog_timeout_event_id = g_timeout_add (timeout * 1000,
- back_prog_on_timeout,
- NULL);
-}
-
-/*
- * This function starts the background program (if any).
- */
-static void
-back_prog_run (void)
-{
- GPid pid = -1;
- GError *error = NULL;
- gchar *command = NULL;
- gchar **back_prog_argv = NULL;
-
- g_assert (back_prog_timeout_event_id == -1);
- g_assert (back_prog_watcher_event_id == -1);
- g_assert (back_prog_pid == -1);
-
- command = back_prog_get_path ();
- if (! command)
- return;
-
- gdm_common_debug ("Running background program <%s>", command);
-
- /* Focus new windows. We want to give focus to the background program. */
- gdm_wm_focus_new_windows (TRUE);
-
- back_prog_argv = ve_split (command);
-
- /* Don't reap child automatically: we want to catch the event. */
- if (! g_spawn_async (".",
- back_prog_argv,
- NULL,
- (GSpawnFlags) (G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD),
- NULL,
- NULL,
- &pid,
- &error)) {
-
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_common_debug ("Cannot run background program %s : %s", command, error->message);
- msg = g_strdup_printf (_("Cannot run command '%s': %s."),
- command,
- error->message);
-
- dialog = ve_hig_dialog_new (NULL,
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot start background application"),
- msg);
- g_free (msg);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_error_free (error);
- g_strfreev (back_prog_argv);
-
- return;
- }
-
- g_strfreev (back_prog_argv);
- back_prog_watcher_event_id = g_child_watch_add (pid,
- back_prog_on_exit,
- NULL);
- back_prog_pid = pid;
- back_prog_has_run = TRUE;
-}
-
-/*
- * This function stops the background program if it is running,
- * and removes any associated timer or watcher.
- */
-static void
-back_prog_stop (void)
-{
- if (back_prog_timeout_event_id != -1) {
- GSource *source = g_main_context_find_source_by_id
- (NULL, back_prog_timeout_event_id);
- if (source != NULL)
- g_source_destroy (source);
-
- back_prog_timeout_event_id = -1;
- }
-
- if (back_prog_watcher_event_id != -1) {
- GSource *source = g_main_context_find_source_by_id
- (NULL, back_prog_watcher_event_id);
- if (source != NULL)
- g_source_destroy (source);
-
- back_prog_watcher_event_id = -1;
- }
-
- if (back_prog_pid != -1) {
- if (kill (back_prog_pid, SIGTERM) == 0) {
- waitpid (back_prog_pid, NULL, 0);
- }
-
- back_prog_pid = -1;
- }
-}
-
-/*
- * Timed Login: Timer
- */
-static gboolean
-gdm_timer (gpointer data)
-{
- if (gdm_timed_delay <= 0) {
- /* timed interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_TIMED_LOGIN);
- fflush (stdout);
- } else {
- gchar *autologin_msg;
-
- /* Note that this message is not handled the same way as in
- * the greeter, we don't parse it through the enriched text.
- */
- autologin_msg = gdm_common_expand_text (
- _("User %u will login in %t"));
- gtk_label_set_text (GTK_LABEL (auto_timed_msg), autologin_msg);
- gtk_widget_show (GTK_WIDGET (auto_timed_msg));
- g_free (autologin_msg);
- login_window_resize (FALSE /* force */);
- }
-
- gdm_timed_delay--;
- return TRUE;
-}
-
-/*
- * Timed Login: On GTK events, increase delay to at least 30
- * seconds, or the GDM_KEY_TIMED_LOGIN_DELAY, whichever is higher
- */
-static gboolean
-gdm_timer_up_delay (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- if (gdm_timed_delay < 30)
- gdm_timed_delay = 30;
- if (gdm_timed_delay < gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY))
- gdm_timed_delay = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
- return TRUE;
-}
-
-/* The reaping stuff */
-static time_t last_reap_delay = 0;
-
-static gboolean
-delay_reaping (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- last_reap_delay = time (NULL);
- return TRUE;
-}
-
-static void
-gdm_kill_thingies (void)
-{
- back_prog_stop ();
-}
-
-static gboolean
-reap_flexiserver (gpointer data)
-{
- int reapminutes = gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES);
-
- if (reapminutes > 0 &&
- ((time (NULL) - last_reap_delay) / 60) > reapminutes) {
- gdm_kill_thingies ();
- _exit (DISPLAY_REMANAGE);
- }
- return TRUE;
-}
-
-
-static gboolean
-gdm_event (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GdkEvent *event;
-
- /* HAAAAAAAAAAAAAAAAACK */
- /* Since the user has not logged in yet and may have left/right
- * mouse buttons switched, we just translate every right mouse click
- * to a left mouse click */
- if (n_param_values != 2 ||
- !G_VALUE_HOLDS (&param_values[1], GDK_TYPE_EVENT))
- return FALSE;
-
- event = g_value_get_boxed (&param_values[1]);
- if ((event->type == GDK_BUTTON_PRESS ||
- event->type == GDK_2BUTTON_PRESS ||
- event->type == GDK_3BUTTON_PRESS ||
- event->type == GDK_BUTTON_RELEASE)
- && event->button.button == 3)
- event->button.button = 1;
-
- /* Support Ctrl-U for blanking the username/password entry */
- if (event->type == GDK_KEY_PRESS &&
- (event->key.state & GDK_CONTROL_MASK) &&
- (event->key.keyval == GDK_u ||
- event->key.keyval == GDK_U)) {
-
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- }
-
- return TRUE;
-}
-
-static void
-gdm_login_done (int sig)
-{
- gdm_kill_thingies ();
- _exit (EXIT_SUCCESS);
-}
-
-static void
-set_screen_pos (GtkWidget *widget, int x, int y)
-{
- int width, height;
-
- g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- gtk_window_get_size (GTK_WINDOW (widget), &width, &height);
-
- /* allow negative values, to be like standard X geometry ones */
- if (x < 0)
- x = gdm_wm_screen.width + x - width;
- if (y < 0)
- y = gdm_wm_screen.height + y - height;
-
- if (x < gdm_wm_screen.x)
- x = gdm_wm_screen.x;
- if (y < gdm_wm_screen.y)
- y = gdm_wm_screen.y;
- if (x > gdm_wm_screen.x + gdm_wm_screen.width - width)
- x = gdm_wm_screen.x + gdm_wm_screen.width - width;
- if (y > gdm_wm_screen.y + gdm_wm_screen.height - height)
- y = gdm_wm_screen.y + gdm_wm_screen.height - height;
-
- gtk_window_move (GTK_WINDOW (widget), x, y);
-}
-
-static guint set_pos_id = 0;
-
-static gboolean
-set_pos_idle (gpointer data)
-{
- if (GdmSetPosition) {
- set_screen_pos (login, GdmPositionX, GdmPositionY);
- } else {
- gdm_wm_center_window (GTK_WINDOW (login));
- }
- set_pos_id = 0;
- return FALSE;
-}
-
-static void
-login_window_resize (gboolean force)
-{
- /* allow opt out if we don't really need
- * a resize */
- if ( ! force) {
- GtkRequisition req;
- int width, height;
-
- gtk_window_get_size (GTK_WINDOW (login), &width, &height);
- gtk_widget_size_request (login, &req);
-
- if (req.width <= width && req.height <= height)
- return;
- }
-
- GTK_WINDOW (login)->need_default_size = TRUE;
- gtk_container_check_resize (GTK_CONTAINER (login));
-
- if (set_pos_id == 0)
- set_pos_id = g_idle_add (set_pos_idle, NULL);
-}
-
-
-typedef struct _CursorOffset {
- int x;
- int y;
-} CursorOffset;
-
-static gboolean
-within_rect (GdkRectangle *rect, int x, int y)
-{
- return
- x >= rect->x &&
- x <= rect->x + rect->width &&
- y >= rect->y &&
- y <= rect->y + rect->height;
-}
-
-/* switch to the xinerama screen where x,y are */
-static void
-set_screen_to_pos (int x, int y)
-{
- if ( ! within_rect (&gdm_wm_screen, x, y)) {
- int i;
- /* If not within gdm_wm_screen boundaries,
- * maybe we want to switch xinerama
- * screen */
- for (i = 0; i < gdm_wm_screens; i++) {
- if (within_rect (&gdm_wm_allscreens[i], x, y)) {
- gdm_wm_set_screen (i);
- break;
- }
- }
- }
-}
-
-static void
-gdm_run_gdmconfig (GtkWidget *w, gpointer data)
-{
- gtk_widget_set_sensitive (browser, FALSE);
-
- /* Make sure to unselect the user */
- if (selected_user != NULL)
- g_free (selected_user);
- selected_user = NULL;
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- /* configure interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_CONFIGURE);
- fflush (stdout);
-}
-
-static void
-gdm_login_restart_handler (void)
-{
- if (gdm_wm_warn_dialog (
- _("Are you sure you want to restart the computer?"), "",
- _("_Restart"), NULL, TRUE) == GTK_RESPONSE_YES) {
-
- closelog ();
-
- gdm_kill_thingies ();
- _exit (DISPLAY_REBOOT);
- }
-}
-
-static void
-gdm_custom_cmd_handler (GtkWidget *widget, gpointer data)
-{
- if (data) {
- int *cmd_id = (int*)data;
- gchar * key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, *cmd_id);
- if (gdm_wm_warn_dialog (
- gdm_config_get_string (key_string) , "", GTK_STOCK_OK, NULL, TRUE) == GTK_RESPONSE_YES) {
-
- printf ("%c%c%c%d\n", STX, BEL, GDM_INTERRUPT_CUSTOM_CMD, *cmd_id);
- fflush (stdout);
- }
-
- g_free (key_string);
- }
-}
-
-static void
-gdm_login_halt_handler (void)
-{
- if (gdm_wm_warn_dialog (
- _("Are you sure you want to Shut Down the computer?"), "",
- _("Shut _Down"), NULL, TRUE) == GTK_RESPONSE_YES) {
-
- closelog ();
-
- gdm_kill_thingies ();
- _exit (DISPLAY_HALT);
- }
-}
-
-static void
-gdm_login_use_chooser_handler (void)
-{
- closelog ();
-
- gdm_kill_thingies ();
- _exit (DISPLAY_RUN_CHOOSER);
-}
-
-static void
-gdm_login_suspend_handler (void)
-{
- if (gdm_wm_warn_dialog (
- _("Are you sure you want to suspend the computer?"), "",
- _("_Suspend"), NULL, TRUE) == GTK_RESPONSE_YES) {
-
- /* suspend interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_SUSPEND);
- fflush (stdout);
- }
-}
-
-static void
-gdm_theme_handler (GtkWidget *widget, gpointer data)
-{
- const char *theme_name = (const char *)data;
-
- printf ("%c%c%c%s\n", STX, BEL, GDM_INTERRUPT_THEME, theme_name);
-
- fflush (stdout);
-
- gdm_set_theme (theme_name);
-
- login_window_resize (FALSE);
- gdm_wm_center_window (GTK_WINDOW (login));
-}
-
-static void
-gdm_login_language_lookup (const gchar* savedlang)
-{
- /* Don't save language unless told otherwise */
- savelang = GTK_RESPONSE_NO;
-
- if (savedlang == NULL)
- savedlang = "";
-
- /* If a different language is selected */
- if (curlang != NULL && strcmp (curlang, LAST_LANGUAGE) != 0) {
- g_free (language);
- if (strcmp (curlang, DEFAULT_LANGUAGE) == 0)
- language = g_strdup ("");
- else
- language = g_strdup (curlang);
-
- /* User's saved language is not the chosen one */
- if (strcmp (savedlang, language) != 0) {
- gchar *firstmsg;
- gchar *secondmsg;
- char *curname, *savedname;
-
- if (strcmp (curlang, DEFAULT_LANGUAGE) == 0) {
- curname = g_strdup (_("System Default"));
- } else {
- curname = gdm_lang_name (curlang,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- TRUE /* untranslated */,
- TRUE /* markup */);
- }
- if (strcmp (savedlang, "") == 0) {
- savedname = g_strdup (_("System Default"));
- } else {
- savedname = gdm_lang_name (savedlang,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- TRUE /* untranslated */,
- TRUE /* markup */);
- }
-
- firstmsg = g_strdup_printf (_("Do you wish to make %s the default for future sessions?"),
- curname);
- secondmsg = g_strdup_printf (_("You have chosen %s for this session, but your default setting is %s."),
- curname, savedname);
- g_free (curname);
- g_free (savedname);
-
- savelang = gdm_wm_query_dialog (firstmsg, secondmsg,
- _("Make _Default"), _("Just For _This Session"), TRUE);
- g_free (firstmsg);
- g_free (secondmsg);
- }
- } else {
- g_free (language);
- language = g_strdup (savedlang);
- }
-}
-
-static int dance_handler = 0;
-
-static gboolean
-dance (gpointer data)
-{
- static double t1 = 0.0, t2 = 0.0;
- double xm, ym;
- int x, y;
- static int width = -1;
- static int height = -1;
-
- if (width == -1)
- width = gdm_wm_screen.width;
- if (height == -1)
- height = gdm_wm_screen.height;
-
- if (login == NULL ||
- login->window == NULL) {
- dance_handler = 0;
- return FALSE;
- }
-
- xm = cos (2.31 * t1);
- ym = sin (1.03 * t2);
-
- t1 += 0.03 + (rand () % 10) / 500.0;
- t2 += 0.03 + (rand () % 10) / 500.0;
-
- x = gdm_wm_screen.x + (width / 2) + (width / 5) * xm;
- y = gdm_wm_screen.y + (height / 2) + (height / 5) * ym;
-
- set_screen_pos (login,
- x - login->allocation.width / 2,
- y - login->allocation.height / 2);
-
- return TRUE;
-}
-
-static gboolean
-evil (const char *user)
-{
- static gboolean old_lock;
-
- if (dance_handler == 0 &&
- /* do not translate */
- strcmp (user, "Start Dancing") == 0) {
- gdm_common_setup_cursor (GDK_UMBRELLA);
- dance_handler = g_timeout_add (50, dance, NULL);
- old_lock = GdmLockPosition;
- GdmLockPosition = TRUE;
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- } else if (dance_handler != 0 &&
- /* do not translate */
- strcmp (user, "Stop Dancing") == 0) {
- gdm_common_setup_cursor (GDK_LEFT_PTR);
- g_source_remove (dance_handler);
- dance_handler = 0;
- GdmLockPosition = old_lock;
- gdm_wm_center_window (GTK_WINDOW (login));
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- /* do not translate */
- } else if (strcmp (user, "Gimme Random Cursor") == 0) {
- gdm_common_setup_cursor (((rand () >> 3) % (GDK_LAST_CURSOR/2)) * 2);
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- /* do not translate */
- } else if (strcmp (user, "Require Quater") == 0 ||
- strcmp (user, "Require Quarter") == 0) {
- /* btw, note that I misspelled quarter before and
- * thus this checks for Quater as well as Quarter to
- * keep compatibility which is obviously important for
- * something like this */
- require_quarter = TRUE;
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-gdm_login_enter (GtkWidget *entry)
-{
- const char *login_string;
- const char *str;
- char *tmp;
-
- if (entry == NULL)
- return;
-
- gtk_widget_set_sensitive (entry, FALSE);
- gtk_widget_set_sensitive (ok_button, FALSE);
- gtk_widget_set_sensitive (start_again_button, FALSE);
-
- login_string = gtk_entry_get_text (GTK_ENTRY (entry));
-
- str = gtk_label_get_text (GTK_LABEL (label));
- if (str != NULL &&
- (strcmp (str, _("Username:")) == 0 ||
- strcmp (str, _("_Username:")) == 0) &&
- /* If in timed login mode, and if this is the login
- * entry. Then an enter by itself is sort of like I want to
- * log in as the timed user, really. */
- ve_string_empty (login_string) &&
- timed_handler_id != 0) {
- /* timed interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_TIMED_LOGIN);
- fflush (stdout);
- return;
- }
-
- if (str != NULL &&
- (strcmp (str, _("Username:")) == 0 ||
- strcmp (str, _("_Username:")) == 0) &&
- /* evilness */
- evil (login_string)) {
- /* obviously being 100% reliable is not an issue for
- this test */
- gtk_widget_set_sensitive (entry, TRUE);
- gtk_widget_grab_focus (entry);
- gtk_window_set_focus (GTK_WINDOW (login), entry);
- return;
- }
-
- /* clear the err_box */
- if (err_box_clear_handler > 0)
- g_source_remove (err_box_clear_handler);
- err_box_clear_handler = 0;
- gtk_label_set_text (GTK_LABEL (err_box), "");
-
- tmp = ve_locale_from_utf8 (gtk_entry_get_text (GTK_ENTRY (entry)));
- printf ("%c%s\n", STX, tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static void
-gdm_login_ok_button_press (GtkButton *button, GtkWidget *entry)
-{
- gdm_login_enter (entry);
-}
-
-static void
-gdm_login_start_again_button_press (GtkButton *button, GtkWidget *entry)
-{
- GtkTreeSelection *selection;
-
- if (browser != NULL) {
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_unselect_all (selection);
- }
-
- if (selected_user != NULL)
- g_free (selected_user);
- selected_user = NULL;
-
- printf ("%c%c%c\n", STX, BEL,
- GDM_INTERRUPT_CANCEL);
- fflush (stdout);
-}
-
-static gboolean
-gdm_login_focus_in (GtkWidget *widget, GdkEventFocus *event)
-{
- if (title_box != NULL)
- gtk_widget_set_state (title_box, GTK_STATE_SELECTED);
-
- if (icon_button != NULL)
- gtk_widget_set_state (icon_button, GTK_STATE_NORMAL);
-
- return FALSE;
-}
-
-static gboolean
-gdm_login_focus_out (GtkWidget *widget, GdkEventFocus *event)
-{
- if (title_box != NULL)
- gtk_widget_set_state (title_box, GTK_STATE_NORMAL);
-
- return FALSE;
-}
-
-static void
-gdm_login_session_handler (GtkWidget *widget)
-{
- gchar *s;
-
- current_session = g_object_get_data (G_OBJECT (widget), SESSION_NAME);
-
- s = g_strdup_printf (_("%s session selected"), gdm_session_name (current_session));
-
- gtk_label_set_text (GTK_LABEL (msg), s);
- g_free (s);
-
- login_window_resize (FALSE /* force */);
-}
-
-static void
-gdm_login_session_init (GtkWidget *menu)
-{
- GSList *sessgrp = NULL;
- GList *tmp;
- GtkWidget *item;
- int num = 1;
- char *label;
-
- current_session = NULL;
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_LAST_SESSION)) {
- current_session = LAST_SESSION;
- item = gtk_radio_menu_item_new_with_mnemonic (NULL, _("_Last"));
- g_object_set_data (G_OBJECT (item),
- SESSION_NAME,
- LAST_SESSION);
- sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_session_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- item = gtk_menu_item_new ();
- gtk_widget_set_sensitive (item, FALSE);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
- }
-
- gdm_session_list_init ();
-
- for (tmp = sessions; tmp != NULL; tmp = tmp->next) {
- GdmSession *session;
- char *file;
-
- file = (char *) tmp->data;
- session = g_hash_table_lookup (sessnames, file);
-
- if (num < 10 &&
- (strcmp (file, GDM_SESSION_FAILSAFE_GNOME) != 0) &&
- (strcmp (file, GDM_SESSION_FAILSAFE_XTERM) != 0))
- label = g_strdup_printf ("_%d. %s", num, session->name);
- else
- label = g_strdup (session->name);
- num++;
-
- item = gtk_radio_menu_item_new_with_mnemonic (sessgrp, label);
- g_free (label);
- g_object_set_data_full (G_OBJECT (item), SESSION_NAME,
- g_strdup (file), (GDestroyNotify) g_free);
-
- sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_session_handler), NULL);
- gtk_widget_show (GTK_WIDGET (item));
- }
-
- /* Select the proper session */
- {
- GSList *tmp;
-
- tmp = sessgrp;
- while (tmp != NULL) {
- GtkWidget *w = tmp->data;
- const char *n;
-
- n = g_object_get_data (G_OBJECT (w), SESSION_NAME);
-
- if (n && strcmp (n, current_session) == 0) {
- gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (w),
- TRUE);
- break;
- }
-
- tmp = tmp->next;
- }
- }
-}
-
-
-static void
-gdm_login_language_handler (GtkWidget *widget)
-{
- gchar *s;
- char *name;
-
- if (!widget)
- return;
-
- curlang = g_object_get_data (G_OBJECT (widget), "Language");
- name = gdm_lang_name (curlang,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- TRUE /* untranslated */,
- TRUE /* makrup */);
- s = g_strdup_printf (_("%s language selected"), name);
- g_free (name);
- gtk_label_set_markup (GTK_LABEL (msg), s);
- g_free (s);
-
- login_window_resize (FALSE /* force */);
-}
-
-
-static GtkWidget *
-gdm_login_language_menu_new (void)
-{
- GtkWidget *menu;
- GtkWidget *item, *ammenu, *nzmenu, *omenu;
- GList *langlist, *li;
- gboolean has_other_locale = FALSE;
- GtkWidget *other_menu;
- const char *g1;
- const char *g2;
- char *menulabel;
- /* Start numbering with 3 since 1-2 is used for toplevel menu */
- int g1_num = 3;
- int g2_num = 3;
- int other_num = 3;
- int num;
-
- langlist = gdm_lang_read_locale_file (gdm_config_get_string (GDM_KEY_LOCALE_FILE));
-
- if (langlist == NULL)
- return NULL;
-
- menu = gtk_menu_new ();
-
- curlang = LAST_LANGUAGE;
-
- item = gtk_radio_menu_item_new_with_mnemonic (NULL, _("_Last"));
- languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_language_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- g_object_set_data (G_OBJECT (item),
- "Language",
- LAST_LANGUAGE);
-
- item = gtk_radio_menu_item_new_with_mnemonic (languages, _("_System Default"));
- languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_language_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- g_object_set_data (G_OBJECT (item),
- "Language",
- DEFAULT_LANGUAGE);
-
- item = gtk_menu_item_new ();
- gtk_widget_set_sensitive (item, FALSE);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
-
- menulabel = g_strdup_printf ("_1. %s", gdm_lang_group1());
- item = gtk_menu_item_new_with_mnemonic (menulabel);
- g_free (menulabel);
- ammenu = gtk_menu_new ();
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), GTK_WIDGET (ammenu));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
-
- menulabel = g_strdup_printf ("_2. %s", gdm_lang_group2());
- item = gtk_menu_item_new_with_mnemonic (menulabel);
- g_free (menulabel);
- nzmenu = gtk_menu_new ();
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), nzmenu);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
-
- other_menu = item = gtk_menu_item_new_with_mnemonic (_("_Other"));
- omenu = gtk_menu_new ();
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), omenu);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
-
- g1 = gdm_lang_group1 ();
- g2 = gdm_lang_group2 ();
-
- for (li = langlist; li != NULL; li = li->next) {
- char *lang = li->data;
- char *name;
- char *untranslated;
- char *group;
- char *p;
- GtkWidget *box, *l;
-
- li->data = NULL;
-
- group = name = gdm_lang_name (lang,
- FALSE /* never_encoding */,
- FALSE /* no_group */,
- FALSE /* untranslated */,
- FALSE /* markup */);
- if (name == NULL) {
- g_free (lang);
- continue;
- }
-
- untranslated = gdm_lang_untranslated_name (lang,
- TRUE /* markup */);
-
- p = strchr (name, '|');
- if (p != NULL) {
- *p = '\0';
- name = p+1;
- }
-
- box = gtk_hbox_new (FALSE, 5);
- gtk_widget_show (box);
-
- if (strcmp (group, g1) == 0)
- num = g1_num++;
- else if (strcmp (group, g2) == 0)
- num = g2_num++;
- else
- num = other_num++;
-
- if (num < 10)
- menulabel = g_strdup_printf ("_%d. %s", num, name);
- else if ((num -10) + (int)'a' <= (int)'z')
- menulabel = g_strdup_printf ("_%c. %s",
- (char)(num-10)+'a',
- name);
- else
- menulabel = g_strdup (name);
-
- l = gtk_label_new_with_mnemonic (menulabel);
- if ( ! gdm_lang_name_translated (lang))
- gtk_widget_set_direction (l, GTK_TEXT_DIR_LTR);
- gtk_widget_show (l);
- gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0);
-
- if (untranslated != NULL) {
- l = gtk_label_new (untranslated);
- /* we really wantd LTR here for the widget */
- gtk_widget_set_direction (l, GTK_TEXT_DIR_LTR);
- gtk_label_set_use_markup (GTK_LABEL (l), TRUE);
- gtk_widget_show (l);
- gtk_box_pack_end (GTK_BOX (box), l, FALSE, FALSE, 0);
- }
-
- item = gtk_radio_menu_item_new (languages);
- gtk_container_add (GTK_CONTAINER (item), box);
- languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
- g_object_set_data_full (G_OBJECT (item),
- "Language",
- g_strdup (lang),
- (GDestroyNotify) g_free);
-
- if (strcmp (group, g1) == 0) {
- gtk_menu_shell_append (GTK_MENU_SHELL (ammenu), item);
- } else if (strcmp (group, g2) == 0) {
- gtk_menu_shell_append (GTK_MENU_SHELL (nzmenu), item);
- } else {
- gtk_menu_shell_append (GTK_MENU_SHELL (omenu), item);
- has_other_locale = TRUE;
- }
-
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_language_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
-
- g_free (lang);
- g_free (group);
- g_free (untranslated);
- }
- if ( ! has_other_locale)
- gtk_widget_destroy (other_menu);
-
- g_list_free (langlist);
-
- return menu;
-}
-
-static gboolean
-theme_allowed (const char *theme)
-{
- gchar * themestoallow = gdm_config_get_string (GDM_KEY_GTK_THEMES_TO_ALLOW);
- char **vec;
- int i;
-
- if (ve_string_empty (themestoallow) ||
- g_ascii_strcasecmp (themestoallow, "all") == 0)
- return TRUE;
-
- vec = g_strsplit (themestoallow, ",", 0);
- if (vec == NULL || vec[0] == NULL)
- return TRUE;
-
- for (i = 0; vec[i] != NULL; i++) {
- if (strcmp (vec[i], theme) == 0) {
- g_strfreev (vec);
- return TRUE;
- }
- }
-
- g_strfreev (vec);
-
- return FALSE;
-}
-
-static GSList *
-build_theme_list (void)
-{
- DIR *dir;
- struct dirent *de;
- gchar *theme_dir;
- GSList *theme_list = NULL;
-
- theme_dir = gtk_rc_get_theme_dir ();
- dir = opendir (theme_dir);
-
- while ((de = readdir (dir))) {
- char *name;
- if (de->d_name[0] == '.')
- continue;
- if ( ! theme_allowed (de->d_name))
- continue;
- name = g_build_filename (theme_dir, de->d_name, GTK_KEY, NULL);
- if (g_file_test (name, G_FILE_TEST_IS_DIR))
- theme_list = g_slist_append (theme_list, g_strdup (de->d_name));
- g_free (name);
- }
- g_free (theme_dir);
- closedir (dir);
-
- return theme_list;
-}
-
-static GtkWidget *
-gdm_login_theme_menu_new (void)
-{
- GSList *theme_list;
- GtkWidget *item;
- GtkWidget *menu;
- int num = 1;
-
- if ( ! gdm_config_get_bool (GDM_KEY_ALLOW_GTK_THEME_CHANGE))
- return NULL;
-
- menu = gtk_menu_new ();
-
- for (theme_list = build_theme_list ();
- theme_list != NULL;
- theme_list = theme_list->next) {
- char *menu_item_name;
- char *theme_name = theme_list->data;
- theme_list->data = NULL;
-
- if (num < 10)
- menu_item_name = g_strdup_printf ("_%d. %s", num, _(theme_name));
- else if ((num -10) + (int)'a' <= (int)'z')
- menu_item_name = g_strdup_printf ("_%c. %s",
- (char)(num-10)+'a',
- _(theme_name));
- else
- menu_item_name = g_strdup (theme_name);
- num++;
-
- item = gtk_menu_item_new_with_mnemonic (menu_item_name);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (GTK_WIDGET (item));
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_theme_handler), theme_name);
- g_free (menu_item_name);
- }
- g_slist_free (theme_list);
- return menu;
-}
-
-static gboolean
-err_box_clear (gpointer data)
-{
- if (err_box != NULL)
- gtk_label_set_text (GTK_LABEL (err_box), "");
-
- err_box_clear_handler = 0;
- return FALSE;
-}
-
-static void
-browser_set_user (const char *user)
-{
- gboolean old_selecting_user = selecting_user;
- GtkTreeSelection *selection;
- GtkTreeIter iter = {0};
- GtkTreeModel *tm = NULL;
-
- if (browser == NULL)
- return;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_unselect_all (selection);
-
- if (ve_string_empty (user))
- return;
-
- selecting_user = FALSE;
-
- tm = gtk_tree_view_get_model (GTK_TREE_VIEW (browser));
-
- if (gtk_tree_model_get_iter_first (tm, &iter))
- {
- do
- {
- char *login;
- gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
- &login, -1);
- if (login != NULL && strcmp (user, login) == 0)
- {
- GtkTreePath *path = gtk_tree_model_get_path (tm, &iter);
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (browser),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- break;
- }
-
- }
- while (gtk_tree_model_iter_next (tm, &iter));
- }
- selecting_user = old_selecting_user;
-}
-
-static Display *
-get_parent_display (void)
-{
- static gboolean tested = FALSE;
- static Display *dsp = NULL;
-
- if (tested)
- return dsp;
-
- tested = TRUE;
-
- if (g_getenv ("GDM_PARENT_DISPLAY") != NULL)
- {
- char *old_xauth = g_strdup (g_getenv ("XAUTHORITY"));
- if (g_getenv ("GDM_PARENT_XAUTHORITY") != NULL)
- {
- g_setenv ("XAUTHORITY",
- g_getenv ("GDM_PARENT_XAUTHORITY"), TRUE);
- }
- dsp = XOpenDisplay (g_getenv ("GDM_PARENT_DISPLAY"));
- if (old_xauth != NULL)
- g_setenv ("XAUTHORITY", old_xauth, TRUE);
- else
- g_unsetenv ("XAUTHORITY");
- g_free (old_xauth);
- }
-
- return dsp;
-}
-
-static gboolean
-greeter_is_capslock_on (void)
-{
- XkbStateRec states;
- Display *dsp;
-
- /* HACK! incredible hack, if GDM_PARENT_DISPLAY is set we get
- * indicator state from the parent display, since we must be inside an
- * Xnest */
- dsp = get_parent_display ();
- if (dsp == NULL)
- dsp = GDK_DISPLAY ();
-
- if (XkbGetState (dsp, XkbUseCoreKbd, &states) != Success)
- return FALSE;
-
- return (states.locked_mods & LockMask) != 0;
-}
-
-static void
-face_browser_select_user (gchar *login)
-{
- printf ("%c%c%c%s\n", STX, BEL,
- GDM_INTERRUPT_SELECT_USER, login);
-
- fflush (stdout);
-}
-
-static gboolean
-gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
-{
- gchar buf[PIPE_SIZE];
- gchar *p;
- gsize len;
-
- /* If this is not incoming i/o then return */
- if (cond != G_IO_IN)
- return (TRUE);
-
- /* Read random garbage from i/o channel until STX is found */
- do {
- g_io_channel_read_chars (source, buf, 1, &len, NULL);
-
- if (len != 1)
- return (TRUE);
- } while (buf[0] && buf[0] != STX);
-
- memset (buf, '\0', sizeof (buf));
- if (g_io_channel_read_chars (source, buf, sizeof (buf) - 1, &len, NULL) !=
- G_IO_STATUS_NORMAL)
- return TRUE;
-
- p = memchr (buf, STX, len);
- if (p != NULL) {
- len = p - buf;
- g_io_channel_seek_position (source, -((sizeof (buf) - 1) - len), G_SEEK_CUR, NULL);
- memset (buf + len, '\0', (sizeof (buf) - 1) - len);
- }
- buf[len - 1] = '\0';
-
- process_operation ((guchar) buf[0], buf + 1);
-
- return TRUE;
-}
-
-static void
-process_operation (guchar op_code,
- const gchar *args)
-{
- char *tmp;
- gint i, x, y;
- GtkWidget *dlg;
- static gboolean replace_msg = TRUE;
- static gboolean messages_to_give = FALSE;
- gint lookup_status = SESSION_LOOKUP_SUCCESS;
- gchar *firstmsg = NULL;
- gchar *secondmsg = NULL;
- gint save_session = GTK_RESPONSE_NO;
-
- /* Parse opcode */
- switch (op_code) {
- case GDM_SETLOGIN:
- /* somebody is trying to fool us this is the user that
- * wants to log in, and well, we are the gullible kind */
- g_free (curuser);
- curuser = g_strdup (args);
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
- browser_set_user (curuser);
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_PROMPT:
- tmp = ve_locale_to_utf8 (args);
- if (tmp != NULL && strcmp (tmp, _("Username:")) == 0) {
- gdm_common_login_sound (gdm_config_get_string (GDM_KEY_SOUND_PROGRAM),
- gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE),
- gdm_config_get_bool (GDM_KEY_SOUND_ON_LOGIN));
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Username:"));
- } else {
- if (tmp != NULL)
- gtk_label_set_text (GTK_LABEL (label), tmp);
- }
- g_free (tmp);
-
- gtk_widget_set_sensitive (GTK_WIDGET (start_again_button), !first_prompt);
- first_prompt = FALSE;
-
- gtk_widget_show (GTK_WIDGET (label));
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
- gtk_entry_set_visibility (GTK_ENTRY (entry), TRUE);
- gtk_widget_set_sensitive (entry, TRUE);
- gtk_widget_set_sensitive (ok_button, FALSE);
- gtk_widget_grab_focus (entry);
- gtk_window_set_focus (GTK_WINDOW (login), entry);
- gtk_widget_show (entry);
-
- /* replace rather then append next message string */
- replace_msg = TRUE;
-
- /* the user has seen messages */
- messages_to_give = FALSE;
-
- login_window_resize (FALSE /* force */);
- break;
-
- case GDM_NOECHO:
- tmp = ve_locale_to_utf8 (args);
- if (tmp != NULL && strcmp (tmp, _("Password:")) == 0) {
- gtk_label_set_text_with_mnemonic (GTK_LABEL (label), _("_Password:"));
- } else {
- if (tmp != NULL)
- gtk_label_set_text (GTK_LABEL (label), tmp);
- }
- g_free (tmp);
-
- gtk_widget_set_sensitive (GTK_WIDGET (start_again_button), !first_prompt);
- first_prompt = FALSE;
-
- gtk_widget_show (GTK_WIDGET (label));
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
- gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
- gtk_widget_set_sensitive (entry, TRUE);
- gtk_widget_set_sensitive (ok_button, FALSE);
- gtk_widget_grab_focus (entry);
- gtk_window_set_focus (GTK_WINDOW (login), entry);
- gtk_widget_show (entry);
-
- /* replace rather then append next message string */
- replace_msg = TRUE;
-
- /* the user has seen messages */
- messages_to_give = FALSE;
-
- login_window_resize (FALSE /* force */);
- break;
-
- case GDM_MSG:
- /* the user has not yet seen messages */
- messages_to_give = TRUE;
-
- /* HAAAAAAACK. Sometimes pam sends many many messages, SO
- * we try to collect them until the next prompt or reset or
- * whatnot */
- if ( ! replace_msg &&
- /* empty message is for clearing */
- ! ve_string_empty (args)) {
- const char *oldtext;
- oldtext = gtk_label_get_text (GTK_LABEL (msg));
- if ( ! ve_string_empty (oldtext)) {
- char *newtext;
- tmp = ve_locale_to_utf8 (args);
- newtext = g_strdup_printf ("%s\n%s", oldtext, tmp);
- g_free (tmp);
- gtk_label_set_text (GTK_LABEL (msg), newtext);
- g_free (newtext);
- } else {
- tmp = ve_locale_to_utf8 (args);
- gtk_label_set_text (GTK_LABEL (msg), tmp);
- g_free (tmp);
- }
- } else {
- tmp = ve_locale_to_utf8 (args);
- gtk_label_set_text (GTK_LABEL (msg), tmp);
- g_free (tmp);
- }
- replace_msg = FALSE;
-
- gtk_widget_show (GTK_WIDGET (msg));
- printf ("%c\n", STX);
- fflush (stdout);
-
- login_window_resize (FALSE /* force */);
-
- break;
-
- case GDM_ERRBOX:
- tmp = ve_locale_to_utf8 (args);
- gtk_label_set_text (GTK_LABEL (err_box), tmp);
- g_free (tmp);
- if (err_box_clear_handler > 0)
- g_source_remove (err_box_clear_handler);
- if (ve_string_empty (args))
- err_box_clear_handler = 0;
- else
- err_box_clear_handler = g_timeout_add (30000,
- err_box_clear,
- NULL);
- printf ("%c\n", STX);
- fflush (stdout);
-
- login_window_resize (FALSE /* force */);
- break;
-
- case GDM_ERRDLG:
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- tmp = ve_locale_to_utf8 (args);
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- tmp,
- "");
- g_free (tmp);
-
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_SESS:
- tmp = ve_locale_to_utf8 (args);
- session = gdm_session_lookup (tmp, &lookup_status);
- if (lookup_status != SESSION_LOOKUP_SUCCESS) {
- switch (lookup_status) {
- case SESSION_LOOKUP_PREFERRED_MISSING:
- firstmsg = g_strdup_printf (_("Do you wish to make %s the default for "
- "future sessions?"),
- gdm_session_name (tmp));
- secondmsg = g_strdup_printf (_("Your preferred session type %s is not "
- "installed on this computer."),
- gdm_session_name (gdm_get_default_session ()));
- save_session = gdm_wm_query_dialog (firstmsg, secondmsg,
- _("Make _Default"), _("Just _Log In"), TRUE);
- g_free (firstmsg);
- g_free (secondmsg);
- gdm_set_save_session (save_session);
- break;
-
- case SESSION_LOOKUP_DEFAULT_MISMATCH:
- firstmsg = g_strdup_printf (_("Do you wish to make %s the default for "
- "future sessions?"),
- gdm_session_name (session));
- secondmsg = g_strdup_printf (_("You have chosen %s for this "
- "session, but your default "
- "setting is %s."),
- gdm_session_name (session),
- gdm_session_name (tmp));
- save_session = gdm_wm_query_dialog (firstmsg, secondmsg,
- _("Make _Default"), _("Just For _This Session"), TRUE);
-
- g_free (firstmsg);
- g_free (secondmsg);
- gdm_set_save_session (save_session);
- break;
- case SESSION_LOOKUP_USE_SWITCHDESK:
- firstmsg = g_strdup_printf (_("You have chosen %s for this "
- "session"),
- gdm_session_name (session));
- secondmsg = g_strdup_printf (_("If you wish to make %s "
- "the default for future sessions, "
- "run the 'switchdesk' utility "
- "(System->Desktop Switching Tool from "
- "the panel menu)."),
- gdm_session_name (session));
- gdm_wm_message_dialog (firstmsg, secondmsg);
- g_free (firstmsg);
- g_free (secondmsg);
- break;
-
- default:
- break;
- }
- }
- g_free (tmp);
- if (gdm_get_save_session () == GTK_RESPONSE_CANCEL) {
- printf ("%c%s\n", STX, GDM_RESPONSE_CANCEL);
- } else {
- tmp = ve_locale_from_utf8 (session);
- printf ("%c%s\n", STX, tmp);
- g_free (tmp);
- }
- fflush (stdout);
- break;
-
- case GDM_LANG:
- gdm_login_language_lookup (args);
- if (savelang == GTK_RESPONSE_CANCEL)
- printf ("%c%s\n", STX, GDM_RESPONSE_CANCEL);
- else
- printf ("%c%s\n", STX, language);
- fflush (stdout);
- break;
-
- case GDM_SSESS:
- if (gdm_get_save_session () == GTK_RESPONSE_YES)
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- case GDM_SLANG:
- if (savelang == GTK_RESPONSE_YES)
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- case GDM_RESET:
- if (gdm_config_get_bool (GDM_KEY_QUIVER) &&
- login->window != NULL &&
- icon_win == NULL &&
- GTK_WIDGET_VISIBLE (login)) {
- Window lw = GDK_WINDOW_XWINDOW (login->window);
-
- gdm_wm_get_window_pos (lw, &x, &y);
-
- for (i = 32 ; i > 0 ; i = i/4) {
- gdm_wm_move_window_now (lw, i+x, y);
- usleep (200);
- gdm_wm_move_window_now (lw, x, y);
- usleep (200);
- gdm_wm_move_window_now (lw, -i+x, y);
- usleep (200);
- gdm_wm_move_window_now (lw, x, y);
- usleep (200);
- }
- }
- /* fall thru to reset */
-
- case GDM_RESETOK:
- if (curuser != NULL) {
- g_free (curuser);
- curuser = NULL;
- }
-
- first_prompt = TRUE;
-
- gtk_widget_set_sensitive (entry, TRUE);
- gtk_widget_set_sensitive (ok_button, FALSE);
- gtk_widget_set_sensitive (start_again_button, FALSE);
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
- gtk_widget_set_sensitive (GTK_WIDGET (browser), TRUE);
-
- tmp = ve_locale_to_utf8 (args);
- gtk_label_set_text (GTK_LABEL (msg), tmp);
- g_free (tmp);
- gtk_widget_show (GTK_WIDGET (msg));
-
- printf ("%c\n", STX);
- fflush (stdout);
-
- login_window_resize (FALSE /* force */);
- break;
-
- case GDM_QUIT:
- if (timed_handler_id != 0) {
- g_source_remove (timed_handler_id);
- timed_handler_id = 0;
- }
-
- if (require_quarter) {
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- /* translators: This is a nice and evil eggie text, translate
- * to your favourite currency */
- _("Please insert 25 cents "
- "to log in."),
- "");
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
- }
-
- /* Hide the login window now */
- gtk_widget_hide (login);
-
- if (messages_to_give) {
- const char *oldtext;
- oldtext = gtk_label_get_text (GTK_LABEL (msg));
-
- if ( ! ve_string_empty (oldtext)) {
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- oldtext,
- "");
- gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
- }
- messages_to_give = FALSE;
- }
-
- gdm_kill_thingies ();
-
- gdk_flush ();
-
- printf ("%c\n", STX);
- fflush (stdout);
-
- /* screw gtk_main_quit, we want to make sure we definately die */
- _exit (EXIT_SUCCESS);
- break;
-
- case GDM_STARTTIMER:
- /*
- * Timed Login: Start Timer Loop
- */
-
- if (timed_handler_id == 0 &&
- gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE) &&
- ! ve_string_empty (gdm_config_get_string (GDM_KEY_TIMED_LOGIN)) &&
- gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY) > 0) {
- gdm_timed_delay = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
- timed_handler_id = g_timeout_add (1000, gdm_timer, NULL);
- }
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_STOPTIMER:
- /*
- * Timed Login: Stop Timer Loop
- */
-
- if (timed_handler_id != 0) {
- g_source_remove (timed_handler_id);
- timed_handler_id = 0;
- }
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_DISABLE:
- if (clock_label != NULL)
- GTK_WIDGET_SET_FLAGS (clock_label->parent, GTK_SENSITIVE);
- gtk_widget_set_sensitive (login, FALSE);
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_ENABLE:
- gtk_widget_set_sensitive (login, TRUE);
- if (clock_label != NULL)
- GTK_WIDGET_UNSET_FLAGS (clock_label->parent, GTK_SENSITIVE);
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- /* These are handled separately so ignore them here and send
- * back a NULL response so that the daemon quits sending them */
- case GDM_NEEDPIC:
- case GDM_READPIC:
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_NOFOCUS:
- gdm_wm_no_login_focus_push ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_FOCUS:
- gdm_wm_no_login_focus_pop ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_SAVEDIE:
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
-
- gdm_kill_thingies ();
- gdk_flush ();
-
- _exit (EXIT_SUCCESS);
-
- case GDM_QUERY_CAPSLOCK:
- if (greeter_is_capslock_on ())
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- default:
- gdm_kill_thingies ();
- gdm_common_fail_greeter ("Unexpected greeter command received: '%c'", op_code);
- break;
- }
-}
-
-
-static void
-gdm_login_browser_populate (void)
-{
- GList *li;
-
- for (li = users; li != NULL; li = li->next) {
- GdmUser *usr = li->data;
- GtkTreeIter iter = {0};
- char *label;
- char *login, *gecos;
-
- login = g_markup_escape_text (usr->login, -1);
- gecos = g_markup_escape_text (usr->gecos, -1);
-
- label = g_strdup_printf ("<b>%s</b>\n%s",
- login,
- gecos);
-
- g_free (login);
- g_free (gecos);
- gtk_list_store_append (GTK_LIST_STORE (browser_model), &iter);
- gtk_list_store_set (GTK_LIST_STORE (browser_model), &iter,
- GREETER_ULIST_ICON_COLUMN, usr->picture,
- GREETER_ULIST_LOGIN_COLUMN, usr->login,
- GREETER_ULIST_LABEL_COLUMN, label,
- -1);
- g_free (label);
- }
- return;
-}
-
-static void
-user_selected (GtkTreeSelection *selection, gpointer data)
-{
- GtkTreeModel *tm = NULL;
- GtkTreeIter iter = {0};
-
-#ifdef FIXME
- g_free (selected_browser_user);
- selected_browser_user = NULL;
-#endif
-
- if (gtk_tree_selection_get_selected (selection, &tm, &iter)) {
- char *login = NULL;
- gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
- &login, -1);
- if (login != NULL) {
- const char *str = gtk_label_get_text (GTK_LABEL (label));
-
- if (selecting_user &&
- str != NULL &&
- (strcmp (str, _("Username:")) == 0 ||
- strcmp (str, _("_Username:")) == 0)) {
- gtk_entry_set_text (GTK_ENTRY (entry), login);
- }
-#ifdef FIXME
- selected_browser_user = g_strdup (login);
-#endif
- if (selecting_user) {
- face_browser_select_user (login);
- if (selected_user != NULL)
- g_free (selected_user);
- selected_user = g_strdup (login);
- }
- }
- }
-}
-
-static void
-browser_change_focus (GtkWidget *widget, GdkEventButton *event, gpointer data)
-{
- gtk_widget_grab_focus (entry);
-}
-
-static gboolean
-gdm_login_handle_pressed (GtkWidget *widget, GdkEventButton *event)
-{
- gint xp, yp;
- GdkModifierType mask;
- CursorOffset *p;
- GdkCursor *fleur_cursor;
-
- if (login == NULL ||
- login->window == NULL ||
- event->type != GDK_BUTTON_PRESS ||
- GdmLockPosition)
- return FALSE;
-
- gdk_window_raise (login->window);
-
- p = g_new0 (CursorOffset, 1);
- g_object_set_data_full (G_OBJECT (widget), "offset", p,
- (GDestroyNotify)g_free);
-
- gdk_window_get_pointer (login->window, &xp, &yp, &mask);
- p->x = xp;
- p->y = yp;
-
- gtk_grab_add (widget);
- fleur_cursor = gdk_cursor_new (GDK_FLEUR);
- gdk_pointer_grab (widget->window, TRUE,
- GDK_BUTTON_RELEASE_MASK |
- GDK_BUTTON_MOTION_MASK |
- GDK_POINTER_MOTION_HINT_MASK,
- NULL,
- fleur_cursor,
- GDK_CURRENT_TIME);
- gdk_cursor_unref (fleur_cursor);
- gdk_flush ();
-
- return TRUE;
-}
-
-static gboolean
-gdm_login_handle_released (GtkWidget *widget, GdkEventButton *event)
-{
- gtk_grab_remove (widget);
- gdk_pointer_ungrab (GDK_CURRENT_TIME);
-
- g_object_set_data (G_OBJECT (widget), "offset", NULL);
-
- return TRUE;
-}
-
-
-static gboolean
-gdm_login_handle_motion (GtkWidget *widget, GdkEventMotion *event)
-{
- int xp, yp;
- CursorOffset *p;
- GdkModifierType mask;
-
- p = g_object_get_data (G_OBJECT (widget), "offset");
-
- if (p == NULL)
- return FALSE;
-
- gdk_window_get_pointer (gdk_get_default_root_window (), &xp, &yp, &mask);
-
- set_screen_to_pos (xp, yp);
-
- GdmSetPosition = TRUE;
- GdmPositionX = xp - p->x;
- GdmPositionY = yp - p->y;
-
- if (GdmPositionX < 0)
- GdmPositionX = 0;
- if (GdmPositionY < 0)
- GdmPositionY = 0;
-
- set_screen_pos (GTK_WIDGET (login), GdmPositionX, GdmPositionY);
-
- return TRUE;
-}
-
-static GtkWidget *
-create_handle (void)
-{
- GtkWidget *hbox, *w;
-
- title_box = gtk_event_box_new ();
- g_signal_connect (G_OBJECT (title_box), "button_press_event",
- G_CALLBACK (gdm_login_handle_pressed),
- NULL);
- g_signal_connect (G_OBJECT (title_box), "button_release_event",
- G_CALLBACK (gdm_login_handle_released),
- NULL);
- g_signal_connect (G_OBJECT (title_box), "motion_notify_event",
- G_CALLBACK (gdm_login_handle_motion),
- NULL);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_container_add (GTK_CONTAINER (title_box), hbox);
- w = gtk_label_new (_("GNOME Desktop Manager"));
- gtk_misc_set_padding (GTK_MISC (w), 4, 4);
- gtk_box_pack_start (GTK_BOX (hbox), w,
- TRUE, TRUE, 4);
-
- gtk_widget_show_all (title_box);
-
- return title_box;
-}
-
-static gboolean
-update_clock (void)
-{
- struct tm *the_tm;
- gchar *str;
- gint time_til_next_min;
-
- if (clock_label == NULL)
- return FALSE;
-
- str = gdm_common_get_clock (&the_tm);
- gtk_label_set_text (GTK_LABEL (clock_label), str);
- g_free (str);
-
- /* account for leap seconds */
- time_til_next_min = 60 - the_tm->tm_sec;
- time_til_next_min = (time_til_next_min>=0?time_til_next_min:0);
-
- g_timeout_add (time_til_next_min*1000, (GSourceFunc)update_clock, NULL);
- return FALSE;
-}
-
-/* doesn't check for executability, just for existence */
-static gboolean
-bin_exists (const char *command)
-{
- char *bin;
-
- if (ve_string_empty (command))
- return FALSE;
-
- /* Note, check only for existence, not for executability */
- bin = ve_first_word (command);
- if (bin != NULL &&
- g_access (bin, F_OK) == 0) {
- g_free (bin);
- return TRUE;
- } else {
- g_free (bin);
- return FALSE;
- }
-}
-
-static gboolean
-window_browser_event (GtkWidget *window, GdkEvent *event, gpointer data)
-{
- switch (event->type) {
- /* FIXME: Fix fingering cuz it's cool */
-#ifdef FIXME
- case GDK_KEY_PRESS:
- if ((event->key.state & GDK_CONTROL_MASK) &&
- (event->key.keyval == GDK_f ||
- event->key.keyval == GDK_F) &&
- selected_browser_user != NULL) {
- GtkWidget *d, *less;
- char *command;
- d = gtk_dialog_new_with_buttons (_("Finger"),
- NULL /* parent */,
- 0 /* flags */,
- GTK_STOCK_OK,
- GTK_RESPONSE_OK,
- NULL);
- gtk_dialog_set_has_separator (GTK_DIALOG (d), FALSE);
- less = gnome_less_new ();
- gtk_widget_show (less);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (d)->vbox),
- less,
- TRUE,
- TRUE,
- 0);
-
- /* hack to make this be the size of a terminal */
- gnome_less_set_fixed_font (GNOME_LESS (less), TRUE);
- {
- int i;
- char buf[82];
- GtkWidget *text = GTK_WIDGET (GNOME_LESS (less)->text);
- GdkFont *font = GNOME_LESS (less)->font;
- for (i = 0; i < 81; i++)
- buf[i] = 'X';
- buf[i] = '\0';
- gtk_widget_set_size_request
- (text,
- gdk_string_width (font, buf) + 30,
- gdk_string_height (font, buf)*24+30);
- }
-
- command = g_strconcat ("finger ",
- selected_browser_user,
- NULL);
- gnome_less_show_command (GNOME_LESS (less), command);
-
- gtk_widget_grab_focus (GTK_WIDGET (less));
-
- gtk_window_set_modal (GTK_WINDOW (d), TRUE);
- gdm_wm_center_window (GTK_WINDOW (d));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
- gdm_wm_no_login_focus_pop ();
- }
- break;
-#endif
- default:
- break;
- }
-
- return FALSE;
-}
-
-static gboolean
-key_release_event (GtkWidget *entry, GdkEventKey *event, gpointer data)
-{
- const char *login_string;
-
- if ((event->keyval == GDK_Tab ||
- event->keyval == GDK_KP_Tab) &&
- (event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_SHIFT_MASK)) == 0) {
- gdm_login_enter (entry);
- return TRUE;
- }
-
- /*
- * Set ok button to sensitive only if there are characters in
- * the entry field
- */
- login_string = gtk_entry_get_text (GTK_ENTRY (entry));
- if (login_string != NULL && login_string[0] != '\0')
- gtk_widget_set_sensitive (ok_button, TRUE);
- else
- gtk_widget_set_sensitive (ok_button, FALSE);
-
- return FALSE;
-}
-
-static void
-gdm_set_welcomemsg (void)
-{
- gchar *greeting;
- gchar *welcomemsg = gdm_common_get_welcomemsg ();
- gchar *fullwelcomemsg = g_strdup_printf (
- "<big><big><big>%s</big></big></big>", welcomemsg);
-
- greeting = gdm_common_expand_text (fullwelcomemsg);
- gtk_label_set_markup (GTK_LABEL (welcome), greeting);
-
- g_free (fullwelcomemsg);
- g_free (welcomemsg);
- g_free (greeting);
-}
-
-static void
-gdm_login_gui_init (void)
-{
- GtkTreeSelection *selection;
- GtkWidget *frame1, *frame2, *ebox;
- GtkWidget *mbox, *menu, *menubar, *item;
- GtkWidget *stack, *hline1, *hline2, *handle;
- GtkWidget *bbox = NULL;
- GtkWidget /**help_button,*/ *button_box;
- gint rows, i;
- GdkPixbuf *pb;
- GtkWidget *frame;
- int lw, lh;
- gboolean have_logo = FALSE;
- GtkWidget *thememenu;
- const gchar *theme_name;
-
- theme_name = g_getenv ("GDM_GTK_THEME");
- if (ve_string_empty (theme_name))
- theme_name = gdm_config_get_string (GDM_KEY_GTK_THEME);
-
- if ( ! ve_string_empty (gdm_config_get_string (GDM_KEY_GTKRC)))
- gtk_rc_parse (gdm_config_get_string (GDM_KEY_GTKRC));
-
- if ( ! ve_string_empty (theme_name)) {
- gdm_set_theme (theme_name);
- }
-
- login = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_object_ref (login);
- g_object_set_data_full (G_OBJECT (login), "login", login,
- (GDestroyNotify) g_object_unref);
-
- gtk_widget_set_events (login, GDK_ALL_EVENTS_MASK);
-
- gtk_window_set_title (GTK_WINDOW (login), _("GDM Login"));
- /* connect for fingering */
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
- g_signal_connect (G_OBJECT (login), "event",
- G_CALLBACK (window_browser_event),
- NULL);
-
- frame1 = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (frame1), GTK_SHADOW_OUT);
- gtk_container_set_border_width (GTK_CONTAINER (frame1), 0);
- gtk_container_add (GTK_CONTAINER (login), frame1);
- g_object_set_data_full (G_OBJECT (login), "frame1", frame1,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (GTK_WIDGET (frame1));
- gtk_widget_show (GTK_WIDGET (frame1));
-
- frame2 = gtk_frame_new (NULL);
- gtk_frame_set_shadow_type (GTK_FRAME (frame2), GTK_SHADOW_IN);
- gtk_container_set_border_width (GTK_CONTAINER (frame2), 2);
- gtk_container_add (GTK_CONTAINER (frame1), frame2);
- g_object_set_data_full (G_OBJECT (login), "frame2", frame2,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_ref (GTK_WIDGET (frame2));
- gtk_widget_show (GTK_WIDGET (frame2));
-
- mbox = gtk_vbox_new (FALSE, 0);
- gtk_widget_ref (mbox);
- g_object_set_data_full (G_OBJECT (login), "mbox", mbox,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (mbox);
- gtk_container_add (GTK_CONTAINER (frame2), mbox);
-
- if (gdm_config_get_bool (GDM_KEY_TITLE_BAR)) {
- handle = create_handle ();
- gtk_box_pack_start (GTK_BOX (mbox), handle, FALSE, FALSE, 0);
- }
-
- menubar = gtk_menu_bar_new ();
- gtk_widget_ref (GTK_WIDGET (menubar));
- gtk_box_pack_start (GTK_BOX (mbox), menubar, FALSE, FALSE, 0);
-
- menu = gtk_menu_new ();
- gdm_login_session_init (menu);
- sessmenu = gtk_menu_item_new_with_mnemonic (_("S_ession"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), sessmenu);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (sessmenu), menu);
- gtk_widget_show (GTK_WIDGET (sessmenu));
-
- menu = gdm_login_language_menu_new ();
- if (menu != NULL) {
- langmenu = gtk_menu_item_new_with_mnemonic (_("_Language"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), langmenu);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (langmenu), menu);
- gtk_widget_show (GTK_WIDGET (langmenu));
- }
-
- if (disable_sys_config_chooser_buttons == FALSE &&
- gdm_config_get_bool (GDM_KEY_SYSTEM_MENU)) {
-
- gboolean got_anything = FALSE;
-
- menu = gtk_menu_new ();
-
- if (gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON)) {
- item = gtk_menu_item_new_with_mnemonic (_("Remote Login via _XDMCP..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_use_chooser_handler),
- NULL);
- gtk_widget_show (item);
- got_anything = TRUE;
- }
-
- /*
- * Disable Configuration if using accessibility (AddGtkModules) since
- * using it with accessibility causes a hang.
- */
- if (gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE) &&
- !gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES) &&
- bin_exists (gdm_config_get_string (GDM_KEY_CONFIGURATOR))) {
- item = gtk_menu_item_new_with_mnemonic (_("_Configure Login Manager..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_run_gdmconfig),
- NULL);
- gtk_widget_show (item);
- got_anything = TRUE;
- }
-
- if (gdm_working_command_exists (gdm_config_get_string (GDM_KEY_REBOOT))) {
- item = gtk_menu_item_new_with_mnemonic (_("_Restart"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_restart_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- got_anything = TRUE;
- }
-
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = NULL;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- if (gdm_working_command_exists (gdm_config_get_string (key_string))) {
- gint * cmd_index = g_new0(gint, 1);
- *cmd_index = i;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- item = gtk_menu_item_new_with_mnemonic (gdm_config_get_string (key_string));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_custom_cmd_handler),
- cmd_index);
- gtk_widget_show (GTK_WIDGET (item));
- got_anything = TRUE;
- }
- g_free (key_string);
- }
-
- if (gdm_working_command_exists (gdm_config_get_string (GDM_KEY_HALT))) {
- item = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_halt_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- got_anything = TRUE;
- }
-
- if (gdm_working_command_exists (gdm_config_get_string (GDM_KEY_SUSPEND))) {
- item = gtk_menu_item_new_with_mnemonic (_("_Suspend"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gdm_login_suspend_handler),
- NULL);
- gtk_widget_show (GTK_WIDGET (item));
- got_anything = TRUE;
- }
-
- if (got_anything) {
- item = gtk_menu_item_new_with_mnemonic (_("_Actions"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), item);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
- gtk_widget_show (GTK_WIDGET (item));
- }
- }
-
- menu = gdm_login_theme_menu_new ();
- if (menu != NULL) {
- thememenu = gtk_menu_item_new_with_mnemonic (_("_Theme"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), thememenu);
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (thememenu), menu);
- gtk_widget_show (GTK_WIDGET (thememenu));
- }
-
- /* Add a quit/disconnect item when in xdmcp mode or flexi mode */
- /* Do note that the order is important, we always want "Quit" for
- * flexi, even if not local (non-local xnest). and Disconnect
- * only for xdmcp */
- if ( ! ve_string_empty (g_getenv ("GDM_FLEXI_SERVER"))) {
- item = gtk_menu_item_new_with_mnemonic (_("_Quit"));
- } else if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
- item = gtk_menu_item_new_with_mnemonic (_("D_isconnect"));
- } else {
- item = NULL;
- }
- if (item != NULL) {
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), item);
- gtk_widget_show (GTK_WIDGET (item));
- g_signal_connect (G_OBJECT (item), "activate",
- G_CALLBACK (gtk_main_quit), NULL);
- }
-
- /* The clock */
- clock_label = gtk_label_new ("");
- gtk_widget_show (clock_label);
- item = gtk_menu_item_new ();
- gtk_container_add (GTK_CONTAINER (item), clock_label);
- gtk_widget_show (item);
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), item);
- gtk_menu_item_set_right_justified (GTK_MENU_ITEM (item), TRUE);
- GTK_WIDGET_UNSET_FLAGS (item, GTK_SENSITIVE);
-
- g_signal_connect (G_OBJECT (clock_label), "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &clock_label);
-
- update_clock ();
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER))
- rows = 2;
- else
- rows = 1;
-
- table = gtk_table_new (rows, 2, FALSE);
- gtk_widget_ref (table);
- g_object_set_data_full (G_OBJECT (login), "table", table,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (table);
- gtk_box_pack_start (GTK_BOX (mbox), table, TRUE, TRUE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (table), 10);
- gtk_table_set_row_spacings (GTK_TABLE (table), 10);
- gtk_table_set_col_spacings (GTK_TABLE (table), 10);
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER)) {
- int height;
- GtkTreeViewColumn *column;
-
- browser = gtk_tree_view_new ();
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (browser), FALSE);
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (browser),
- FALSE);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- g_signal_connect (selection, "changed",
- G_CALLBACK (user_selected),
- NULL);
-
- g_signal_connect (browser, "button_release_event",
- G_CALLBACK (browser_change_focus),
- NULL);
-
- browser_model = (GtkTreeModel *)gtk_list_store_new (3,
- GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING);
-
- gtk_tree_view_set_model (GTK_TREE_VIEW (browser), browser_model);
- column = gtk_tree_view_column_new_with_attributes
- (_("Icon"),
- gtk_cell_renderer_pixbuf_new (),
- "pixbuf", GREETER_ULIST_ICON_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column);
-
- column = gtk_tree_view_column_new_with_attributes
- (_("Username"),
- gtk_cell_renderer_text_new (),
- "markup", GREETER_ULIST_LABEL_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (browser), column);
-
- bbox = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (bbox),
- GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (bbox),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (bbox), browser);
-
- height = size_of_users + 4 /* some padding */;
- if (height > gdm_wm_screen.height * 0.25)
- height = gdm_wm_screen.height * 0.25;
-
- gtk_widget_set_size_request (GTK_WIDGET (bbox), -1, height);
- }
-
- if (gdm_config_get_string (GDM_KEY_LOGO) != NULL) {
- pb = gdk_pixbuf_new_from_file (gdm_config_get_string (GDM_KEY_LOGO), NULL);
- } else {
- pb = NULL;
- }
-
- if (pb != NULL) {
- have_logo = TRUE;
- logo_image = gtk_image_new_from_pixbuf (pb);
- lw = gdk_pixbuf_get_width (pb);
- lh = gdk_pixbuf_get_height (pb);
- g_object_unref (G_OBJECT (pb));
- } else {
- logo_image = gtk_image_new ();
- lw = lh = 100;
- }
-
- /* this will make the logo always left justified */
- logo_frame = gtk_alignment_new (0, 0.10, 0, 0);
- gtk_widget_show (logo_frame);
-
- frame = gtk_frame_new (NULL);
- gtk_widget_show (frame);
- gtk_frame_set_shadow_type (GTK_FRAME (frame),
- GTK_SHADOW_IN);
-
- ebox = gtk_event_box_new ();
- gtk_widget_show (ebox);
- gtk_container_add (GTK_CONTAINER (ebox), logo_image);
- gtk_container_add (GTK_CONTAINER (frame), ebox);
- gtk_container_add (GTK_CONTAINER (logo_frame), frame);
-
- if (lw > gdm_wm_screen.width / 2)
- lw = gdm_wm_screen.width / 2;
- else
- lw = -1;
- if (lh > (2 * gdm_wm_screen.height) / 3)
- lh = (2 * gdm_wm_screen.height) / 3;
- else
- lh = -1;
- if (lw > -1 || lh > -1)
- gtk_widget_set_size_request (logo_image, lw, lh);
- gtk_widget_show (GTK_WIDGET (logo_image));
-
- stack = gtk_table_new (7, 1, FALSE);
- gtk_widget_ref (stack);
- g_object_set_data_full (G_OBJECT (login), "stack", stack,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (stack);
-
- /* Welcome msg */
- welcome = gtk_label_new (NULL);
- gdm_set_welcomemsg ();
- gtk_widget_set_name (welcome, _("Welcome"));
- gtk_widget_ref (welcome);
- g_object_set_data_full (G_OBJECT (login), "welcome", welcome,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (welcome);
- gtk_table_attach (GTK_TABLE (stack), welcome, 0, 1, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 15);
-
- /* Put in error box here */
- err_box = gtk_label_new (NULL);
- gtk_widget_set_name (err_box, "Error box");
- g_signal_connect (G_OBJECT (err_box), "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &err_box);
- gtk_label_set_line_wrap (GTK_LABEL (err_box), TRUE);
- gtk_table_attach (GTK_TABLE (stack), err_box, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
-
-
- hline1 = gtk_hseparator_new ();
- gtk_widget_ref (hline1);
- g_object_set_data_full (G_OBJECT (login), "hline1", hline1,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (hline1);
- gtk_table_attach (GTK_TABLE (stack), hline1, 0, 1, 2, 3,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 6);
-
- label = gtk_label_new_with_mnemonic (_("_Username:"));
- gtk_widget_ref (label);
- g_object_set_data_full (G_OBJECT (login), "label", label,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (label);
- gtk_table_attach (GTK_TABLE (stack), label, 0, 1, 3, 4,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 0, 0);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- gtk_misc_set_padding (GTK_MISC (label), 10, 5);
- gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-
- entry = gtk_entry_new ();
- /*
- * Connect this on key release so we can make the OK button
- * sensitive based on whether the entry field has data.
- */
- g_signal_connect (G_OBJECT (entry), "key_release_event",
- G_CALLBACK (key_release_event), NULL);
- if (gdm_config_get_bool (GDM_KEY_ENTRY_INVISIBLE))
- gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0);
- else if (gdm_config_get_bool (GDM_KEY_ENTRY_CIRCLES))
- gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0x25cf);
- gtk_entry_set_max_length (GTK_ENTRY (entry), PW_ENTRY_SIZE);
- gtk_widget_set_size_request (entry, 250, -1);
- gtk_widget_ref (entry);
- g_object_set_data_full (G_OBJECT (login), "entry", entry,
- (GDestroyNotify) gtk_widget_unref);
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- gtk_widget_show (entry);
- gtk_table_attach (GTK_TABLE (stack), entry, 0, 1, 4, 5,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (0), 10, 0);
- g_signal_connect (G_OBJECT(entry), "activate",
- G_CALLBACK (gdm_login_enter),
- NULL);
-
- /* cursor blinking is evil on remote displays, don't do it forever */
- gdm_common_setup_blinking ();
- gdm_common_setup_blinking_entry (entry);
-
- hline2 = gtk_hseparator_new ();
- gtk_widget_ref (hline2);
- g_object_set_data_full (G_OBJECT (login), "hline2", hline2,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (hline2);
- gtk_table_attach (GTK_TABLE (stack), hline2, 0, 1, 5, 6,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 10);
-
- msg = gtk_label_new (NULL);
- gtk_widget_set_name (msg, "Message");
- gtk_label_set_line_wrap (GTK_LABEL (msg), TRUE);
- gtk_label_set_justify (GTK_LABEL (msg), GTK_JUSTIFY_LEFT);
- gtk_table_attach (GTK_TABLE (stack), msg, 0, 1, 6, 7,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 10);
-
- gtk_widget_ref (msg);
- g_object_set_data_full (G_OBJECT (login), "msg", msg,
- (GDestroyNotify) gtk_widget_unref);
- gtk_widget_show (msg);
-
- auto_timed_msg = gtk_label_new ("");
- gtk_widget_set_name (auto_timed_msg, "Message");
- gtk_label_set_line_wrap (GTK_LABEL (auto_timed_msg), TRUE);
- gtk_label_set_justify (GTK_LABEL (auto_timed_msg), GTK_JUSTIFY_LEFT);
- gtk_table_attach (GTK_TABLE (stack), auto_timed_msg, 0, 1, 7, 8,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 10);
- gtk_widget_set_size_request (auto_timed_msg, -1, 15);
-
- gtk_widget_ref (auto_timed_msg);
- gtk_widget_show (auto_timed_msg);
-
- /* FIXME: No Documentation yet.... */
- /*help_button = gtk_button_new_from_stock (GTK_STOCK_OK);
- GTK_WIDGET_UNSET_FLAGS (help_button, GTK_CAN_FOCUS);
- gtk_widget_show (help_button);*/
-
- ok_button = gtk_button_new_from_stock (GTK_STOCK_OK);
- GTK_WIDGET_UNSET_FLAGS (ok_button, GTK_CAN_FOCUS);
- g_signal_connect (G_OBJECT (ok_button), "clicked",
- G_CALLBACK (gdm_login_ok_button_press),
- entry);
- gtk_widget_show (ok_button);
-
- start_again_button = gtk_button_new_with_mnemonic (_("_Start Again"));
- GTK_WIDGET_UNSET_FLAGS (start_again_button, GTK_CAN_FOCUS);
- g_signal_connect (G_OBJECT (start_again_button), "clicked",
- G_CALLBACK (gdm_login_start_again_button_press),
- entry);
- gtk_widget_show (start_again_button);
-
- button_box = gtk_hbutton_box_new ();
- gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box),
- GTK_BUTTONBOX_END);
- gtk_box_set_spacing (GTK_BOX (button_box), 10);
-
-#if 0
- gtk_box_pack_end (GTK_BOX (button_box), GTK_WIDGET (help_button),
- FALSE, TRUE, 0);
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (button_box), help_button, TRUE);
-#endif
-
- gtk_box_pack_end (GTK_BOX (button_box), GTK_WIDGET (start_again_button),
- FALSE, TRUE, 0);
- gtk_box_pack_end (GTK_BOX (button_box), GTK_WIDGET (ok_button),
- FALSE, TRUE, 0);
- gtk_widget_show (button_box);
-
- gtk_table_attach (GTK_TABLE (stack), button_box, 0, 1, 8, 9,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 10, 10);
-
- /* Put it nicely together */
-
- if (bbox != NULL) {
- gtk_table_attach (GTK_TABLE (table), bbox, 0, 2, 0, 1,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
- gtk_table_attach (GTK_TABLE (table), logo_frame, 0, 1, 1, 2,
- (GtkAttachOptions) (GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- gtk_table_attach (GTK_TABLE (table), stack, 1, 2, 1, 2,
- (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- } else {
- gtk_table_attach (GTK_TABLE (table), logo_frame, 0, 1, 0, 1,
- (GtkAttachOptions) (0),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- gtk_table_attach (GTK_TABLE (table), stack, 1, 2, 0, 1,
- (GtkAttachOptions) (0),
- (GtkAttachOptions) (GTK_FILL), 0, 0);
- }
-
- gtk_widget_grab_focus (entry);
- gtk_window_set_focus (GTK_WINDOW (login), entry);
- g_object_set (G_OBJECT (login),
- "allow_grow", TRUE,
- "allow_shrink", TRUE,
- "resizable", TRUE,
- NULL);
-
- /* do it now, and we'll also do it later */
- if (GdmSetPosition) {
- set_screen_pos (login, GdmPositionX, GdmPositionY);
- } else {
- gdm_wm_center_window (GTK_WINDOW (login));
- }
-
- g_signal_connect (G_OBJECT (login), "focus_in_event",
- G_CALLBACK (gdm_login_focus_in),
- NULL);
- g_signal_connect (G_OBJECT (login), "focus_out_event",
- G_CALLBACK (gdm_login_focus_out),
- NULL);
-
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
-
- /* normally disable the prompt first */
- if ( ! DOING_GDM_DEVELOPMENT) {
- gtk_widget_set_sensitive (entry, FALSE);
- gtk_widget_set_sensitive (ok_button, FALSE);
- gtk_widget_set_sensitive (start_again_button, FALSE);
- }
-
- gtk_widget_show_all (GTK_WIDGET (login));
- if ( ! have_logo) {
- gtk_table_set_col_spacings (GTK_TABLE (table), 0);
- gtk_widget_hide (logo_frame);
- }
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER)) {
- /* Make sure userlist has no users selected */
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (browser));
- gtk_tree_selection_unselect_all (selection);
- if (selected_user)
- g_free (selected_user);
- selected_user = NULL;
- }
-}
-
-static void
-set_root (GdkPixbuf *pb)
-{
- GdkPixmap *pm;
- gint width, height;
-
- g_return_if_fail (pb != NULL);
-
- gdk_drawable_get_size (gdk_get_default_root_window (), &width, &height);
- pm = gdk_pixmap_new (gdk_get_default_root_window (),
- width, height, -1);
-
-
- /* paranoia */
- if (pm == NULL)
- return;
-
- gdk_draw_pixbuf (pm, NULL, pb, 0, 0, 0, 0, -1, -1,
- GDK_RGB_DITHER_MAX, 0, 0);
-
- gdk_error_trap_push ();
-
- gdk_window_set_back_pixmap (gdk_get_default_root_window (),
- pm,
- FALSE /* parent_relative */);
-
- g_object_unref (G_OBJECT (pm));
-
- gdk_window_clear (gdk_get_default_root_window ());
-
- gdk_flush ();
- gdk_error_trap_pop ();
-}
-
-static GdkPixbuf *
-render_scaled_back (const GdkPixbuf *pb)
-{
- int i;
- int width, height;
-
- GdkPixbuf *back = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
- gdk_pixbuf_get_has_alpha (pb),
- 8,
- gdk_screen_width (),
- gdk_screen_height ());
-
- width = gdk_pixbuf_get_width (pb);
- height = gdk_pixbuf_get_height (pb);
-
- for (i = 0; i < gdm_wm_screens; i++) {
- gdk_pixbuf_scale (pb, back,
- gdm_wm_allscreens[i].x,
- gdm_wm_allscreens[i].y,
- gdm_wm_allscreens[i].width,
- gdm_wm_allscreens[i].height,
- gdm_wm_allscreens[i].x /* offset_x */,
- gdm_wm_allscreens[i].y /* offset_y */,
- (double) gdm_wm_allscreens[i].width / width,
- (double) gdm_wm_allscreens[i].height / height,
- GDK_INTERP_BILINEAR);
- }
-
- return back;
-}
-
-static void
-add_color_to_pb (GdkPixbuf *pb, GdkColor *color)
-{
- int width = gdk_pixbuf_get_width (pb);
- int height = gdk_pixbuf_get_height (pb);
- int rowstride = gdk_pixbuf_get_rowstride (pb);
- guchar *pixels = gdk_pixbuf_get_pixels (pb);
- gboolean has_alpha = gdk_pixbuf_get_has_alpha (pb);
- int i;
- int cr = color->red >> 8;
- int cg = color->green >> 8;
- int cb = color->blue >> 8;
-
- if ( ! has_alpha)
- return;
-
- for (i = 0; i < height; i++) {
- int ii;
- guchar *p = pixels + (rowstride * i);
- for (ii = 0; ii < width; ii++) {
- int r = p[0];
- int g = p[1];
- int b = p[2];
- int a = p[3];
-
- p[0] = (r * a + cr * (255 - a)) >> 8;
- p[1] = (g * a + cg * (255 - a)) >> 8;
- p[2] = (b * a + cb * (255 - a)) >> 8;
- p[3] = 255;
-
- p += 4;
- }
- }
-}
-
-/* setup background color/image */
-static void
-setup_background (void)
-{
- GdkColor color;
- GdkPixbuf *pb = NULL;
- gchar *bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
- gchar *bg_image = gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
- gint bg_type = gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE);
-
- if ((bg_type == GDM_BACKGROUND_IMAGE ||
- bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) &&
- ! ve_string_empty (bg_image))
- pb = gdk_pixbuf_new_from_file (bg_image, NULL);
-
- /* Load background image */
- if (pb != NULL) {
- if (gdk_pixbuf_get_has_alpha (pb)) {
- if (bg_type == GDM_BACKGROUND_IMAGE_AND_COLOR) {
- if (bg_color == NULL ||
- bg_color[0] == '\0' ||
- ! gdk_color_parse (bg_color,
- &color)) {
- gdk_color_parse ("#000000", &color);
- }
- add_color_to_pb (pb, &color);
- }
- }
- if (gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT)) {
- GdkPixbuf *spb = render_scaled_back (pb);
- g_object_unref (G_OBJECT (pb));
- pb = spb;
- }
-
- /* paranoia */
- if (pb != NULL) {
- set_root (pb);
- g_object_unref (G_OBJECT (pb));
- }
- /* Load background color */
- } else if (bg_type != GDM_BACKGROUND_NONE &&
- bg_type != GDM_BACKGROUND_IMAGE) {
- gdm_common_setup_background_color (bg_color);
- /* Load default background */
- } else {
- gchar *blank_color = g_strdup ("#000000");
- gdm_common_setup_background_color (blank_color);
- }
-}
-
-enum {
- RESPONSE_RESTART,
- RESPONSE_REBOOT,
- RESPONSE_CLOSE
-};
-
-/*
- * If new configuration keys are added to this program, make sure to add the
- * key to the gdm_read_config and gdm_reread_config functions. Note if the
- * number of configuration values used by gdmlogin is greater than
- * GDM_SUP_MAX_MESSAGES defined in daemon/gdm.h (currently defined to be 80),
- * consider bumping that number so that all the config can be read in one
- * socket connection.
- */
-static void
-gdm_read_config (void)
-{
- gint i;
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /*
- * Read all the keys at once and close sockets connection so we do
- * not have to keep the socket open.
- */
- gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
- gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
- gdm_config_get_string (GDM_KEY_BACKGROUND_PROGRAM);
- gdm_config_get_string (GDM_KEY_CONFIGURATOR);
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE);
- gdm_config_get_string (GDM_KEY_DEFAULT_SESSION);
- gdm_config_get_string (GDM_KEY_EXCLUDE);
- gdm_config_get_string (GDM_KEY_GTK_THEME);
- gdm_config_get_string (GDM_KEY_GTK_THEMES_TO_ALLOW);
- gdm_config_get_string (GDM_KEY_GTKRC);
- gdm_config_get_string (GDM_KEY_HALT);
- gdm_config_get_string (GDM_KEY_INCLUDE);
- gdm_config_get_string (GDM_KEY_INFO_MSG_FILE);
- gdm_config_get_string (GDM_KEY_INFO_MSG_FONT);
- gdm_config_get_string (GDM_KEY_LOCALE_FILE);
- gdm_config_get_string (GDM_KEY_LOGO);
- gdm_config_get_string (GDM_KEY_REBOOT);
- gdm_config_get_string (GDM_KEY_REMOTE_WELCOME);
- gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
- gdm_config_get_string (GDM_KEY_SOUND_PROGRAM);
- gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE);
- gdm_config_get_string (GDM_KEY_SUSPEND);
- gdm_config_get_string (GDM_KEY_TIMED_LOGIN);
- gdm_config_get_string (GDM_KEY_USE_24_CLOCK);
- gdm_config_get_string (GDM_KEY_WELCOME);
-
- /* String keys for custom commands */
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = NULL;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- g_free (key_string);
- }
-
- gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE);
- gdm_config_get_int (GDM_KEY_BACKGROUND_PROGRAM_INITIAL_DELAY);
- gdm_config_get_int (GDM_KEY_BACKGROUND_PROGRAM_RESTART_DELAY);
- gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES);
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- gdm_config_get_int (GDM_KEY_MINIMAL_UID);
- gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
- gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN);
-
- gdm_config_get_bool (GDM_KEY_ALLOW_GTK_THEME_CHANGE);
- gdm_config_get_bool (GDM_KEY_ALLOW_REMOTE_ROOT);
- gdm_config_get_bool (GDM_KEY_ALLOW_ROOT);
- gdm_config_get_bool (GDM_KEY_BACKGROUND_REMOTE_ONLY_COLOR);
- gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT);
- gdm_config_get_bool (GDM_KEY_BROWSER);
- gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON);
- gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE);
- gdm_config_get_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME);
- gdm_config_get_bool (GDM_KEY_DEFAULT_WELCOME);
- gdm_config_get_bool (GDM_KEY_ENTRY_CIRCLES);
- gdm_config_get_bool (GDM_KEY_ENTRY_INVISIBLE);
- gdm_config_get_bool (GDM_KEY_INCLUDE_ALL);
- gdm_config_get_bool (GDM_KEY_QUIVER);
- gdm_config_get_bool (GDM_KEY_RUN_BACKGROUND_PROGRAM_ALWAYS);
- gdm_config_get_bool (GDM_KEY_RESTART_BACKGROUND_PROGRAM);
- gdm_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE);
- gdm_config_get_bool (GDM_KEY_SHOW_LAST_SESSION);
- gdm_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE);
- gdm_config_get_bool (GDM_KEY_SOUND_ON_LOGIN);
- gdm_config_get_bool (GDM_KEY_SYSTEM_MENU);
- gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE);
- gdm_config_get_bool (GDM_KEY_TITLE_BAR);
- gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
-
- /* Keys not to include in reread_config */
- gdm_config_get_bool (GDM_KEY_LOCK_POSITION);
- gdm_config_get_int (GDM_KEY_POSITION_X);
- gdm_config_get_int (GDM_KEY_POSITION_Y);
- gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
- gdm_config_get_bool (GDM_KEY_SET_POSITION);
-
- gdmcomm_comm_bulk_stop ();
-}
-
-static gboolean
-gdm_reread_config (int sig, gpointer data)
-{
- gboolean resize = FALSE;
- gboolean custom_changed = FALSE;
- gint i;
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- if (gdm_config_reload_bool (GDM_KEY_DEBUG))
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /* reparse config stuff here. At least the ones we care about */
- /*
- * We don't want to reload GDM_KEY_POSITION_X, GDM_KEY_POSITION_Y
- * GDM_KEY_LOCK_POSITION, and GDM_KEY_SET_POSITION since we don't
- * want to move the window or lock its position just because the
- * config default changed. It would be too confusing to have the
- * window location move around. These changes can wait until the
- * next time gdmlogin is launched.
- */
-
- /* FIXME: We should update these on the fly rather than just
- * restarting */
- /* Also we may not need to check ALL those keys but just a few */
-
- if (gdm_config_reload_string (GDM_KEY_BACKGROUND_PROGRAM) ||
- gdm_config_reload_string (GDM_KEY_CONFIGURATOR) ||
- gdm_config_reload_string (GDM_KEY_DEFAULT_FACE) ||
- gdm_config_reload_string (GDM_KEY_DEFAULT_SESSION) ||
- gdm_config_reload_string (GDM_KEY_EXCLUDE) ||
- gdm_config_reload_string (GDM_KEY_GTKRC) ||
- gdm_config_reload_string (GDM_KEY_GTK_THEME) ||
- gdm_config_reload_string (GDM_KEY_GTK_THEMES_TO_ALLOW) ||
- gdm_config_reload_string (GDM_KEY_HALT) ||
- gdm_config_reload_string (GDM_KEY_INCLUDE) ||
- gdm_config_reload_string (GDM_KEY_INFO_MSG_FILE) ||
- gdm_config_reload_string (GDM_KEY_INFO_MSG_FONT) ||
- gdm_config_reload_string (GDM_KEY_LOCALE_FILE) ||
- gdm_config_reload_string (GDM_KEY_REBOOT) ||
- gdm_config_reload_string (GDM_KEY_SESSION_DESKTOP_DIR) ||
- gdm_config_reload_string (GDM_KEY_SUSPEND) ||
- gdm_config_reload_string (GDM_KEY_TIMED_LOGIN) ||
-
- gdm_config_reload_int (GDM_KEY_BACKGROUND_PROGRAM_INITIAL_DELAY) ||
- gdm_config_reload_int (GDM_KEY_BACKGROUND_PROGRAM_RESTART_DELAY) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_WIDTH) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_HEIGHT) ||
- gdm_config_reload_int (GDM_KEY_MINIMAL_UID) ||
- gdm_config_reload_int (GDM_KEY_TIMED_LOGIN_DELAY) ||
- gdm_config_reload_int (GDM_KEY_XINERAMA_SCREEN) ||
-
- gdm_config_reload_bool (GDM_KEY_ALLOW_GTK_THEME_CHANGE) ||
- gdm_config_reload_bool (GDM_KEY_ALLOW_ROOT) ||
- gdm_config_reload_bool (GDM_KEY_ALLOW_REMOTE_ROOT) ||
- gdm_config_reload_bool (GDM_KEY_BROWSER) ||
- gdm_config_reload_bool (GDM_KEY_CHOOSER_BUTTON) ||
- gdm_config_reload_bool (GDM_KEY_CONFIG_AVAILABLE) ||
- gdm_config_reload_bool (GDM_KEY_ENTRY_CIRCLES) ||
- gdm_config_reload_bool (GDM_KEY_ENTRY_INVISIBLE) ||
- gdm_config_reload_bool (GDM_KEY_INCLUDE_ALL) ||
- gdm_config_reload_bool (GDM_KEY_QUIVER) ||
- gdm_config_reload_bool (GDM_KEY_RESTART_BACKGROUND_PROGRAM) ||
- gdm_config_reload_bool (GDM_KEY_RUN_BACKGROUND_PROGRAM_ALWAYS) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_GNOME_FAILSAFE) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_LAST_SESSION) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_XTERM_FAILSAFE) ||
- gdm_config_reload_bool (GDM_KEY_SYSTEM_MENU) ||
- gdm_config_reload_bool (GDM_KEY_TIMED_LOGIN_ENABLE) ||
- gdm_config_reload_bool (GDM_KEY_TITLE_BAR) ||
- gdm_config_reload_bool (GDM_KEY_ADD_GTK_MODULES)) {
-
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
- gdm_kill_thingies ();
- gdmcomm_comm_bulk_stop ();
-
- _exit (DISPLAY_RESTARTGREETER);
- return TRUE;
- }
-
- /* Keys for custom commands */
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar *key_string = NULL;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- if(gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- if(gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- if(gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, i);
- if(gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- if(gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- g_free (key_string);
- }
-
- if(custom_changed){
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
- gdm_kill_thingies ();
- gdmcomm_comm_bulk_stop ();
-
- _exit (DISPLAY_RESTARTGREETER);
- return TRUE;
- }
-
- if (gdm_config_reload_string (GDM_KEY_BACKGROUND_IMAGE) ||
- gdm_config_reload_string (GDM_KEY_BACKGROUND_COLOR) ||
- gdm_config_reload_int (GDM_KEY_BACKGROUND_TYPE) ||
- gdm_config_reload_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT) ||
- gdm_config_reload_bool (GDM_KEY_BACKGROUND_REMOTE_ONLY_COLOR)) {
-
- gdm_kill_thingies ();
- setup_background ();
- back_prog_launch_after_timeout ();
- }
-
- gdm_config_reload_string (GDM_KEY_SOUND_PROGRAM);
- gdm_config_reload_bool (GDM_KEY_SOUND_ON_LOGIN);
- gdm_config_reload_string (GDM_KEY_SOUND_ON_LOGIN_FILE);
- gdm_config_reload_string (GDM_KEY_USE_24_CLOCK);
- update_clock ();
-
- if (gdm_config_reload_string (GDM_KEY_LOGO)) {
- GdkPixbuf *pb;
- gboolean have_logo = FALSE;
- gchar *gdmlogo;
- int lw, lh;
-
- gdmlogo = gdm_config_get_string (GDM_KEY_LOGO);
-
- if (gdmlogo != NULL) {
- pb = gdk_pixbuf_new_from_file (gdmlogo, NULL);
- } else {
- pb = NULL;
- }
-
- if (pb != NULL) {
- have_logo = TRUE;
- gtk_image_set_from_pixbuf (GTK_IMAGE (logo_image), pb);
- lw = gdk_pixbuf_get_width (pb);
- lh = gdk_pixbuf_get_height (pb);
- g_object_unref (G_OBJECT (pb));
- } else {
- lw = lh = 100;
- }
-
- if (lw > gdm_wm_screen.width / 2)
- lw = gdm_wm_screen.width / 2;
- else
- lw = -1;
- if (lh > (2 * gdm_wm_screen.height) / 3)
- lh = (2 * gdm_wm_screen.height) / 3;
- else
- lh = -1;
- if (lw > -1 || lh > -1)
- gtk_widget_set_size_request (logo_image, lw, lh);
-
- if (have_logo) {
- gtk_table_set_col_spacings (GTK_TABLE (table), 10);
- gtk_widget_show (logo_frame);
- } else {
- gtk_table_set_col_spacings (GTK_TABLE (table), 0);
- gtk_widget_hide (logo_frame);
- }
-
- resize = TRUE;
- }
-
- if (gdm_config_reload_string (GDM_KEY_WELCOME) ||
- gdm_config_reload_bool (GDM_KEY_DEFAULT_WELCOME) ||
- gdm_config_reload_string (GDM_KEY_REMOTE_WELCOME) ||
- gdm_config_reload_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME)) {
-
- gdm_set_welcomemsg ();
- }
-
- if (resize)
- login_window_resize (TRUE /* force */);
-
- gdmcomm_comm_bulk_stop ();
-
- return TRUE;
-}
-
-int
-main (int argc, char *argv[])
-{
- struct sigaction hup;
- struct sigaction term;
- sigset_t mask;
- GIOChannel *ctrlch;
- const char *gdm_version;
- const char *gdm_protocol_version;
- guint sid;
-
- if (g_getenv ("DOING_GDM_DEVELOPMENT") != NULL)
- DOING_GDM_DEVELOPMENT = TRUE;
-
- gdm_common_openlog ("gdmlogin", LOG_PID, LOG_DAEMON);
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- /*
- * gdm_common_atspi_launch () needs gdk initialized.
- * We cannot start gtk before the registry is running
- * because the atk-bridge will crash.
- */
- gdk_init (&argc, &argv);
- if ( ! DOING_GDM_DEVELOPMENT) {
- gdm_common_atspi_launch ();
- }
-
- gtk_init (&argc, &argv);
-
- if (ve_string_empty (g_getenv ("GDM_IS_LOCAL")))
- disable_sys_config_chooser_buttons = TRUE;
-
- /* Read all configuration at once, so the values get cached */
- gdm_read_config ();
-
- GdmLockPosition = gdm_config_get_bool (GDM_KEY_LOCK_POSITION);
- GdmSetPosition = gdm_config_get_bool (GDM_KEY_SET_POSITION);
- GdmPositionX = gdm_config_get_int (GDM_KEY_POSITION_X);
- GdmPositionY = gdm_config_get_int (GDM_KEY_POSITION_Y);
- setlocale (LC_ALL, "");
-
- gdm_wm_screen_init (gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN));
-
- gdm_version = g_getenv ("GDM_VERSION");
- gdm_protocol_version = g_getenv ("GDM_GREETER_PROTOCOL_VERSION");
-
- /* Load the background as early as possible so GDM does not leave */
- /* the background unfilled. The cursor should be a watch already */
- /* but just in case */
- setup_background ();
- gdm_common_setup_cursor (GDK_WATCH);
-
- if ( ! DOING_GDM_DEVELOPMENT &&
- ((gdm_protocol_version != NULL &&
- strcmp (gdm_protocol_version, GDM_GREETER_PROTOCOL_VERSION) != 0) ||
- (gdm_protocol_version == NULL &&
- (gdm_version == NULL ||
- strcmp (gdm_version, VERSION) != 0))) &&
- ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
-
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version. "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
-
- return EXIT_SUCCESS;
- }
-
- if ( ! DOING_GDM_DEVELOPMENT &&
- gdm_protocol_version == NULL &&
- gdm_version == NULL) {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
-
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version. "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("Restart"),
- RESPONSE_REBOOT,
- GTK_STOCK_CLOSE,
- RESPONSE_CLOSE,
- NULL);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
- case RESPONSE_REBOOT:
- gtk_widget_destroy (dialog);
- return DISPLAY_REBOOT;
- default:
- gtk_widget_destroy (dialog);
- return DISPLAY_ABORT;
- }
- }
-
- if ( ! DOING_GDM_DEVELOPMENT &&
- ((gdm_protocol_version != NULL &&
- strcmp (gdm_protocol_version, GDM_GREETER_PROTOCOL_VERSION) != 0) ||
- (gdm_protocol_version == NULL &&
- strcmp (gdm_version, VERSION) != 0))) {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
-
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version (%s). "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION, gdm_version);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("Restart GDM"),
- RESPONSE_RESTART,
- _("Restart computer"),
- RESPONSE_REBOOT,
- GTK_STOCK_CLOSE,
- RESPONSE_CLOSE,
- NULL);
-
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), RESPONSE_RESTART);
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
- case RESPONSE_RESTART:
- gtk_widget_destroy (dialog);
- return DISPLAY_RESTARTGDM;
- case RESPONSE_REBOOT:
- gtk_widget_destroy (dialog);
- return DISPLAY_REBOOT;
- default:
- gtk_widget_destroy (dialog);
- return DISPLAY_ABORT;
- }
- }
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER)) {
- defface = gdm_common_get_face (NULL,
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE),
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH),
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT));
-
- if (! defface) {
- gdm_common_warning ("Could not open DefaultImage: %s. Suspending face browser!",
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE));
- browser_ok = FALSE;
- } else {
- gdm_users_init (&users, &users_string, NULL, defface,
- &size_of_users, login_is_local, !DOING_GDM_DEVELOPMENT);
- }
- }
-
- /* Do not display face browser widget if no users */
- if (!users)
- browser_ok = FALSE;
-
- gdm_login_gui_init ();
-
- if (browser_ok && gdm_config_get_bool (GDM_KEY_BROWSER)) {
- gdm_login_browser_populate ();
- }
-
- ve_signal_add (SIGHUP, gdm_reread_config, NULL);
-
- hup.sa_handler = ve_signal_notify;
- hup.sa_flags = 0;
- sigemptyset (&hup.sa_mask);
- sigaddset (&hup.sa_mask, SIGCHLD);
-
- if G_UNLIKELY (sigaction (SIGHUP, &hup, NULL) < 0) {
- gdm_kill_thingies ();
- gdm_common_fail_greeter (_("%s: Error setting up %s signal handler: %s"), "main",
- "HUP", strerror (errno));
- }
-
- term.sa_handler = gdm_login_done;
- term.sa_flags = 0;
- sigemptyset (&term.sa_mask);
- sigaddset (&term.sa_mask, SIGCHLD);
-
- if G_UNLIKELY (sigaction (SIGINT, &term, NULL) < 0) {
- gdm_kill_thingies ();
- gdm_common_fail_greeter (_("%s: Error setting up %s signal handler: %s"), "main",
- "INT", strerror (errno));
- }
-
- if G_UNLIKELY (sigaction (SIGTERM, &term, NULL) < 0) {
- gdm_kill_thingies ();
- gdm_common_fail_greeter (_("%s: Error setting up %s signal handler: %s"), "main",
- "TERM", strerror (errno));
- }
-
- sigemptyset (&mask);
- sigaddset (&mask, SIGTERM);
- sigaddset (&mask, SIGHUP);
- sigaddset (&mask, SIGINT);
-
- if G_UNLIKELY (sigprocmask (SIG_UNBLOCK, &mask, NULL) == -1) {
- gdm_kill_thingies ();
- gdm_common_fail_greeter (_("Could not set signal mask!"));
- }
-
- g_atexit (gdm_kill_thingies);
- back_prog_launch_after_timeout ();
-
- if G_LIKELY ( ! DOING_GDM_DEVELOPMENT) {
- ctrlch = g_io_channel_unix_new (STDIN_FILENO);
- g_io_channel_set_encoding (ctrlch, NULL, NULL);
- g_io_channel_set_buffered (ctrlch, TRUE);
- g_io_channel_set_flags (ctrlch,
- g_io_channel_get_flags (ctrlch) | G_IO_FLAG_NONBLOCK,
- NULL);
- g_io_add_watch (ctrlch,
- G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
- (GIOFunc) gdm_login_ctrl_handler,
- NULL);
- g_io_channel_unref (ctrlch);
- }
-
- /* if in timed mode, delay timeout on keyboard or menu
- * activity */
- if (gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE) &&
- ! ve_string_empty (gdm_config_get_string (GDM_KEY_TIMED_LOGIN))) {
- sid = g_signal_lookup ("activate",
- GTK_TYPE_MENU_ITEM);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("key_release_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("button_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
- }
-
- /* if a flexiserver, reap self after some time */
- if (gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES) > 0 &&
- ! ve_string_empty (g_getenv ("GDM_FLEXI_SERVER")) &&
- /* but don't reap Xnest flexis */
- ve_string_empty (g_getenv ("GDM_PARENT_DISPLAY"))) {
- sid = g_signal_lookup ("activate",
- GTK_TYPE_MENU_ITEM);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("key_release_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("button_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- last_reap_delay = time (NULL);
- g_timeout_add (60*1000, reap_flexiserver, NULL);
- }
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- gtk_widget_queue_resize (login);
- gtk_widget_show_now (login);
-
- if (GdmSetPosition) {
- set_screen_pos (login, GdmPositionX, GdmPositionY);
- } else {
- gdm_wm_center_window (GTK_WINDOW (login));
- }
-
- /* can it ever happen that it'd be NULL here ??? */
- if G_UNLIKELY (login->window != NULL) {
- gdm_wm_init (GDK_WINDOW_XWINDOW (login->window));
-
- /* Run the focus, note that this will work no matter what
- * since gdm_wm_init will set the display to the gdk one
- * if it fails */
- gdm_wm_focus_window (GDK_WINDOW_XWINDOW (login->window));
- }
-
- if G_UNLIKELY (session_dir_whacked_out) {
- GtkWidget *dialog;
-
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Session directory is missing"),
- _("Your session directory is missing or empty! "
- "There are two available sessions you can use, but "
- "you should log in and correct the GDM configuration."));
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- }
-
- if G_UNLIKELY (g_getenv ("GDM_WHACKED_GREETER_CONFIG") != NULL) {
- GtkWidget *dialog;
-
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Configuration is not correct"),
- _("The configuration file contains an invalid command "
- "line for the login dialog, so running the "
- "default command. Please fix your configuration."));
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- }
-
- gdm_wm_restore_wm_order ();
-
- gdm_wm_show_info_msg_dialog (gdm_config_get_string (GDM_KEY_INFO_MSG_FILE),
- gdm_config_get_string (GDM_KEY_INFO_MSG_FONT));
-
- /* Only setup the cursor now since it will be a WATCH from before */
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_common_pre_fetch_launch ();
- gtk_main ();
-
- gdm_kill_thingies ();
-
- return EXIT_SUCCESS;
-}
-
-/* EOF */
diff --git a/gui/gdmphotosetup.c b/gui/gdmphotosetup.c
deleted file mode 100644
index 881a793a..00000000
--- a/gui/gdmphotosetup.c
+++ /dev/null
@@ -1,362 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDMphotosetup - graphical .gnome2/photo setup program for users
- *
- * Copyright (C) 2001 Queen of England
- * Copyright (C) 2005 William Jon McCann <mccann@jhu.edu>
- *
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include "config.h"
-#include <sys/types.h>
-#include <signal.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-
-#include <glib.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-
-#include "gdm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "ve-miscui.h"
-
-static GladeXML *xml;
-static char *photofile;
-static char *facedir;
-static char *imagename;
-static int max_width, max_height;
-
-static void
-dialog_response (GtkWidget *dialog,
- int res,
- gpointer data)
-{
- if (res == GTK_RESPONSE_HELP)
- return;
-
- gtk_main_quit ();
-}
-
-static GdkPixbuf *
-scale_pixbuf (GdkPixbuf *pixbuf)
-{
- float scale_factor_x = 1.0;
- float scale_factor_y = 1.0;
- float scale_factor = 1.0;
- GdkPixbuf *scaled = NULL;
-
- /* Determine which dimension requires the smallest scale. */
- if (gdk_pixbuf_get_width (pixbuf) > max_width)
- scale_factor_x = (float) max_width /
- (float) gdk_pixbuf_get_width (pixbuf);
-
- if (gdk_pixbuf_get_height (pixbuf) > max_height)
- scale_factor_y = (float) max_height /
- (float) gdk_pixbuf_get_height (pixbuf);
-
- if (scale_factor_x > scale_factor_y)
- scale_factor = scale_factor_y;
- else
- scale_factor = scale_factor_x;
-
- /* Only scale if it needs to be scaled smaller */
- if (scale_factor >= 1.0) {
- scaled = g_object_ref (pixbuf);
- } else {
- int scale_x = (int) (gdk_pixbuf_get_width (pixbuf) *
- scale_factor);
- int scale_y = (int) (gdk_pixbuf_get_height (pixbuf) *
- scale_factor);
-
- /* Scale bigger dimension to max icon height/width */
- scaled = gdk_pixbuf_scale_simple (pixbuf,
- scale_x,
- scale_y,
- GDK_INTERP_BILINEAR);
- }
-
- return scaled;
-}
-
-static GdkPixbuf *
-create_preview_pixbuf (const gchar *uri)
-{
- GdkPixbuf *pixbuf = NULL;
-
- if ((uri != NULL) && (uri[0] != '\0')) {
-
- gchar *file = NULL;
-
- if (g_path_is_absolute (uri) == TRUE) {
- file = g_strdup (uri);
- }
- else {
- /* URIs are local, because gtk_file_chooser_get_local_only() is true. */
- file = g_filename_from_uri (uri, NULL, NULL);
- }
-
- if (file != NULL) {
-
- GdkPixbufFormat *info;
- gint width;
- gint height;
-
- info = gdk_pixbuf_get_file_info (file, &width, &height);
-
- if (width > 128 || height > 128) {
- pixbuf = gdk_pixbuf_new_from_file_at_size (file, 128, 128, NULL);
- }
- else {
- pixbuf = gdk_pixbuf_new_from_file (file, NULL);
- }
- g_free (file);
- }
- }
- return pixbuf;
-}
-
-static void
-update_preview_cb (GtkFileChooser *chooser)
-{
- GtkWidget *image;
- gchar *uri;
-
- image = gtk_file_chooser_get_preview_widget (GTK_FILE_CHOOSER (chooser));
- uri = gtk_file_chooser_get_preview_uri (chooser);
-
- if (uri != NULL) {
-
- GdkPixbuf *pixbuf = NULL;
-
- pixbuf = create_preview_pixbuf (uri);
-
- if (pixbuf != NULL) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
- g_object_unref (pixbuf);
- }
- else {
- gtk_image_set_from_stock (GTK_IMAGE (image),
- "gtk-dialog-question",
- GTK_ICON_SIZE_DIALOG);
- }
- }
- gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
-}
-
-static void
-set_face_from_filename (const char *filename)
-{
- GtkWidget *image;
- GdkPixbuf *pixbuf;
- GdkPixbuf *scaled;
-
- image = glade_xml_get_widget (xml, "face_image");
-
- pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
- scaled = scale_pixbuf (pixbuf);
- g_object_unref (pixbuf);
- pixbuf = scaled;
-
- if (! pixbuf)
- return;
-
- if (gdk_pixbuf_save (pixbuf, photofile, "png", NULL, NULL) != TRUE) {
- GtkWidget *d;
- char *tmp = g_filename_to_utf8 (photofile, -1, NULL, NULL, NULL);
- char *msg;
-
- msg = g_strdup_printf (_("File %s cannot be opened for "
- "writing."), tmp);
-
- d = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot open file"),
- msg);
-
- gtk_dialog_run (GTK_DIALOG (d));
- gtk_widget_destroy (d);
-
- g_free (tmp);
- g_free (msg);
- } else {
- /* Change to g_chmod after glib 2.8 release */
- g_chmod (photofile, 0644);
- }
-
- gtk_image_set_from_file (GTK_IMAGE (image), photofile);
-}
-
-static void
-install_response (GtkWidget *file_dialog,
- gint response,
- gpointer data)
-{
- if (response == GTK_RESPONSE_ACCEPT) {
- g_free (imagename);
- imagename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_dialog));
- set_face_from_filename (imagename);
- }
-
- gtk_widget_destroy (file_dialog);
-}
-
-static void
-add_preview_widget (GtkWidget *widget)
-{
- GtkWidget *image;
-
- image = gtk_image_new ();
- gtk_widget_set_size_request (image, 128, 128);
-
- gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (widget), image);
-
- gtk_image_set_from_pixbuf (GTK_IMAGE (image),
- create_preview_pixbuf (imagename));
-
- g_signal_connect (widget, "update-preview",
- G_CALLBACK (update_preview_cb), NULL);
-}
-
-static void
-browse_button_cb (GtkWidget *widget, gpointer data)
-{
- GtkWindow *parent = GTK_WINDOW (data);
- GtkFileFilter *filter;
- GtkWidget *file_dialog;
-
- file_dialog = gtk_file_chooser_dialog_new (_("Select User Image"),
- parent,
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
- NULL);
-
- gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (file_dialog), FALSE);
- gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (file_dialog), TRUE);
- gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (file_dialog), FALSE);
-
- if (facedir && g_file_test (facedir, G_FILE_TEST_IS_DIR)) {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_dialog),
- facedir);
- gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (file_dialog),
- facedir, NULL);
- } else {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (file_dialog),
- DATADIR "/pixmaps");
- gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (file_dialog),
- DATADIR "/pixmaps", NULL);
- }
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_dialog), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern(filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (file_dialog), filter);
-
- if (imagename != NULL) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_dialog), imagename);
- }
-
- add_preview_widget (file_dialog);
-
- g_signal_connect (G_OBJECT (file_dialog), "response",
- G_CALLBACK (install_response), NULL);
-
- gtk_widget_show (file_dialog);
-}
-
-static void
-help_button_cb (GtkWidget *widget, gpointer data)
-{
- g_spawn_command_line_sync ("gnome-open ghelp:gdm", NULL, NULL,
- NULL, NULL);
-}
-
-int
-main (int argc, char *argv[])
-{
- GtkWidget *dialog;
- GtkWidget *browse_button;
- GtkWidget *help_button;
- GtkWidget *face_image;
- gboolean face_browser;
- char *greeter;
- int max_size;
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
- gtk_init(&argc, &argv);
- photofile = g_build_filename (g_get_home_dir (), ".face", NULL);
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
- face_browser = gdm_config_get_bool (GDM_KEY_BROWSER);
- max_size = gdm_config_get_int (GDM_KEY_USER_MAX_FILE);
- max_width = gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- max_height = gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- greeter = gdm_config_get_string (GDM_KEY_GREETER);
- facedir = gdm_config_get_string (GDM_KEY_GLOBAL_FACE_DIR);
- /* At this point we are done using the socket, so close it */
- gdmcomm_comm_bulk_stop ();
- imagename = NULL;
-
- gtk_window_set_default_icon_name ("stock_person");
-
- xml = glade_xml_new (GDM_GLADE_DIR "/gdmphotosetup.glade", NULL, NULL);
-
- dialog = glade_xml_get_widget (xml, "face_dialog");
- face_image = glade_xml_get_widget (xml, "face_image");
- browse_button = glade_xml_get_widget (xml, "browse_button");
- help_button = glade_xml_get_widget (xml, "helpbutton1");
-
- gtk_widget_set_size_request (browse_button, MAX (max_width, 230), MAX (max_height, 130));
-
- if (g_access (photofile, R_OK) == 0) {
- gtk_image_set_from_file (GTK_IMAGE (face_image),
- photofile);
- } else {
- gtk_image_set_from_icon_name (GTK_IMAGE (face_image),
- "stock_person",
- GTK_ICON_SIZE_DIALOG);
- }
-
- g_signal_connect (browse_button, "clicked",
- G_CALLBACK (browse_button_cb), dialog);
- g_signal_connect (help_button, "clicked",
- G_CALLBACK (help_button_cb), dialog);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (dialog_response), NULL);
-
- gtk_widget_show_all (dialog);
- gtk_main ();
-
- return 0;
-}
diff --git a/gui/gdmphotosetup.desktop.in b/gui/gdmphotosetup.desktop.in
deleted file mode 100644
index b0c1e285..00000000
--- a/gui/gdmphotosetup.desktop.in
+++ /dev/null
@@ -1,15 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-_Name=Login Photo
-_GenericName=Login Photo
-_Comment=Change the picture that will show in the GDM (login manager) face browser
-TryExec=gdmphotosetup
-Exec=gdmphotosetup
-Icon=login-photo.png
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=GNOME;GTK;Settings;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gdm
-X-GNOME-Bugzilla-Component=general
diff --git a/gui/gdmphotosetup.glade b/gui/gdmphotosetup.glade
deleted file mode 100644
index 4255151c..00000000
--- a/gui/gdmphotosetup.glade
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="face_dialog">
- <property name="border_width">5</property>
- <property name="visible">False</property>
- <property name="title" translatable="yes">Login Photo Preferences</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">False</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="helpbutton1">
- <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="closebutton1">
- <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>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox6">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;User Image&lt;/b&gt;</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</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="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xscale">1</property>
- <property name="yscale">1</property>
- <property name="top_padding">0</property>
- <property name="bottom_padding">0</property>
- <property name="left_padding">12</property>
- <property name="right_padding">0</property>
-
- <child>
- <widget class="GtkButton" id="browse_button">
- <property name="visible">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="GtkImage" id="face_image">
- <property name="visible">True</property>
- <property name="icon_size">6</property>
- <property name="icon_name">stock_person</property>
- <property name="xalign">0.5</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>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/gui/gdmsession.c b/gui/gdmsession.c
deleted file mode 100644
index 40253976..00000000
--- a/gui/gdmsession.c
+++ /dev/null
@@ -1,492 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 "config.h"
-
-#include <unistd.h>
-#include <dirent.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "vicious.h"
-
-#include "gdm.h"
-#include "gdmsession.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-
-GHashTable *sessnames = NULL;
-gchar *default_session = NULL;
-const gchar *current_session = NULL;
-GList *sessions = NULL;
-static gint save_session = GTK_RESPONSE_NO;
-
-
-/* This is true if session dir doesn't exist or is whacked out
- * in some way or another */
-gboolean session_dir_whacked_out = FALSE;
-
-gint
-gdm_session_sort_func (const char *a, const char *b)
-{
- /* Put default and GNOME sessions at the top */
- if (strcmp (a, ve_sure_string (gdm_config_get_string (GDM_KEY_DEFAULT_SESSION))) == 0)
- return -1;
-
- if (strcmp (b, ve_sure_string (gdm_config_get_string (GDM_KEY_DEFAULT_SESSION))) == 0)
- return 1;
-
- if (strcmp (a, "default.desktop") == 0)
- return -1;
-
- if (strcmp (b, "default.desktop") == 0)
- return 1;
-
- if (strcmp (a, "gnome.desktop") == 0)
- return -1;
-
- if (strcmp (b, "gnome.desktop") == 0)
- return 1;
-
- /* put failsafe sessions on the bottom */
- if (strcmp (b, GDM_SESSION_FAILSAFE_XTERM) == 0)
- return -1;
-
- if (strcmp (a, GDM_SESSION_FAILSAFE_XTERM) == 0)
- return 1;
-
- if (strcmp (b, GDM_SESSION_FAILSAFE_GNOME) == 0)
- return -1;
-
- if (strcmp (a, GDM_SESSION_FAILSAFE_GNOME) == 0)
- return 1;
-
- /* put everything else in the middle in alphabetical order */
- return strcmp (a, b);
-}
-
-const char *
-gdm_session_name (const char *name)
-{
- GdmSession *session;
-
- /* eek */
- if G_UNLIKELY (name == NULL)
- return "(null)";
-
- session = g_hash_table_lookup (sessnames, name);
- if (session != NULL && !ve_string_empty (session->name))
- return session->name;
- else
- return name;
-}
-
-void
-gdm_session_list_from_hash_table_func (const char *key, const char *value,
- GList **sessions)
-{
- *sessions = g_list_prepend (*sessions, g_strdup (key));
-}
-
-/* Just a wrapper to ensure compatibility with the
- existing code */
-void
-gdm_session_list_init ()
-{
- _gdm_session_list_init (&sessnames, &sessions,
- &default_session, &current_session);
-}
-
-/* The real gdm_session_list_init */
-void
-_gdm_session_list_init (GHashTable **sessnames, GList **sessions,
- gchar **default_session, const gchar **current_session)
-{
-
- GdmSession *session = NULL;
- gboolean some_dir_exists = FALSE;
- gboolean searching_for_default = TRUE;
- struct dirent *dent;
- char **vec;
- char *name;
- DIR *sessdir;
- int i;
-
- *sessnames = g_hash_table_new (g_str_hash, g_str_equal);
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE)) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (_("Failsafe _GNOME"));
- session->clearname = g_strdup (_("Failsafe GNOME"));
- session->comment = g_strdup (_("This is a failsafe session that will log you "
- "into GNOME. No startup scripts will be read "
- "and it is only to be used when you can't log "
- "in otherwise. GNOME will use the 'Default' "
- "session."));
- g_hash_table_insert (*sessnames, g_strdup (GDM_SESSION_FAILSAFE_GNOME), session);
- }
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE)) {
- /* Valgrind complains that the below is leaked */
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (_("Failsafe _Terminal"));
- session->clearname = g_strdup (_("Failsafe Terminal"));
- session->comment = g_strdup (_("This is a failsafe session that will log you "
- "into a terminal. No startup scripts will be read "
- "and it is only to be used when you can't log "
- "in otherwise. To exit the terminal, "
- "type 'exit'."));
- g_hash_table_insert (*sessnames, g_strdup (GDM_SESSION_FAILSAFE_XTERM),
- session);
- }
-
- vec = g_strsplit (gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR),
- ":", -1);
- for (i = 0; vec != NULL && vec[i] != NULL; i++) {
- const char *dir = vec[i];
-
- /* Check that session dir is readable */
- if G_UNLIKELY (dir == NULL || access (dir, R_OK|X_OK) != 0)
- continue;
-
- some_dir_exists = TRUE;
-
- /* Read directory entries in session dir */
- sessdir = opendir (dir);
-
- if G_LIKELY (sessdir != NULL)
- dent = readdir (sessdir);
- else
- dent = NULL;
-
- while (dent != NULL) {
- VeConfig *cfg;
- char *exec;
- char *comment;
- char *s;
- char *tryexec;
- char *ext;
-
- /* ignore everything but the .desktop files */
- ext = strstr (dent->d_name, ".desktop");
- if (ext == NULL ||
- strcmp (ext, ".desktop") != 0) {
- dent = readdir (sessdir);
- continue;
- }
-
- /* already found this session, ignore */
- if (g_hash_table_lookup (*sessnames, dent->d_name) != NULL) {
- dent = readdir (sessdir);
- continue;
- }
-
- s = g_strconcat (dir, "/", dent->d_name, NULL);
- cfg = ve_config_new (s);
- g_free (s);
-
- if (ve_config_get_bool (cfg, "Desktop Entry/Hidden=false")) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (dent->d_name);
- session->clearname = NULL;
- g_hash_table_insert (*sessnames, g_strdup (dent->d_name), session);
- ve_config_destroy (cfg);
- dent = readdir (sessdir);
- continue;
- }
-
- tryexec = ve_config_get_string (cfg, "Desktop Entry/TryExec");
- if ( ! ve_string_empty (tryexec)) {
- char **tryexecvec = g_strsplit (tryexec, " ", -1);
- char *full = NULL;
-
- /* Do not pass any arguments to g_find_program_in_path */
- if (tryexecvec != NULL)
- full = g_find_program_in_path (tryexecvec[0]);
-
- if (full == NULL) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (dent->d_name);
- session->clearname = NULL;
- g_hash_table_insert (*sessnames, g_strdup (dent->d_name),
- session);
- g_free (tryexec);
- ve_config_destroy (cfg);
- dent = readdir (sessdir);
- continue;
- }
- g_strfreev (tryexecvec);
- g_free (full);
- }
- g_free (tryexec);
-
- exec = ve_config_get_string (cfg, "Desktop Entry/Exec");
- name = ve_config_get_translated_string (cfg, "Desktop Entry/Name");
- comment = ve_config_get_translated_string (cfg, "Desktop Entry/Comment");
-
- ve_config_destroy (cfg);
-
- if G_UNLIKELY (ve_string_empty (exec) || ve_string_empty (name)) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (dent->d_name);
- session->clearname = NULL;
- g_hash_table_insert (*sessnames, g_strdup (dent->d_name), session);
- g_free (exec);
- g_free (name);
- g_free (comment);
- dent = readdir (sessdir);
- continue;
- }
-
- /* if we found the default session */
- if (default_session != NULL) {
- if ( ! ve_string_empty (gdm_config_get_string (GDM_KEY_DEFAULT_SESSION)) &&
- strcmp (dent->d_name, gdm_config_get_string (GDM_KEY_DEFAULT_SESSION)) == 0) {
- g_free (*default_session);
- *default_session = g_strdup (dent->d_name);
- searching_for_default = FALSE;
- }
-
- /* if there is a session called Default */
- if (searching_for_default &&
- g_ascii_strcasecmp (dent->d_name, "default.desktop") == 0) {
- g_free (*default_session);
- *default_session = g_strdup (dent->d_name);
- }
-
- if (searching_for_default &&
- g_ascii_strcasecmp (dent->d_name, "gnome.desktop") == 0) {
- /* Just in case there is no default session and
- * no default link, make gnome the default */
- if (*default_session == NULL)
- *default_session = g_strdup (dent->d_name);
-
- }
- }
-
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (name);
- session->clearname = NULL;
- session->comment = g_strdup (comment);
- g_hash_table_insert (*sessnames, g_strdup (dent->d_name), session);
- g_free (exec);
- g_free (comment);
- dent = readdir (sessdir);
- }
-
- if G_LIKELY (sessdir != NULL)
- closedir (sessdir);
- }
-
- g_strfreev (vec);
-
- /* Check that session dir is readable */
- if G_UNLIKELY ( ! some_dir_exists) {
- gdm_common_error ("%s: Session directory <%s> not found!",
- "gdm_session_list_init", ve_sure_string
- (gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR)));
- session_dir_whacked_out = TRUE;
- }
-
- if G_UNLIKELY (g_hash_table_size (*sessnames) == 0) {
- gdm_common_warning ("Error, no sessions found in the session directory <%s>.",
- ve_sure_string (gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR)));
-
- session_dir_whacked_out = TRUE;
- if (default_session != NULL)
- *default_session = g_strdup (GDM_SESSION_FAILSAFE_GNOME);
- }
-
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE)) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (_("Failsafe _GNOME"));
- session->clearname = g_strdup (_("Failsafe GNOME"));
- session->comment = g_strdup (_("This is a failsafe session that will log you "
- "into GNOME. No startup scripts will be read "
- "and it is only to be used when you can't log "
- "in otherwise. GNOME will use the 'Default' "
- "session."));
- g_hash_table_insert (*sessnames,
- g_strdup (GDM_SESSION_FAILSAFE_GNOME), session);
- }
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE)) {
- session = g_new0 (GdmSession, 1);
- session->name = g_strdup (_("Failsafe _Terminal"));
- session->clearname = g_strdup (_("Failsafe Terminal"));
- session->comment = g_strdup (_("This is a failsafe session that will log you "
- "into a terminal. No startup scripts will be read "
- "and it is only to be used when you can't log "
- "in otherwise. To exit the terminal, "
- "type 'exit'."));
- g_hash_table_insert (*sessnames,
- g_strdup (GDM_SESSION_FAILSAFE_XTERM), session);
- }
-
- /* Convert to list (which is unsorted) */
- g_hash_table_foreach (*sessnames,
- (GHFunc) gdm_session_list_from_hash_table_func, sessions);
-
- /* Prioritize and sort the list */
- *sessions = g_list_sort (*sessions, (GCompareFunc) gdm_session_sort_func);
-
- if (default_session != NULL)
- if G_UNLIKELY (*default_session == NULL) {
- *default_session = g_strdup (GDM_SESSION_FAILSAFE_GNOME);
- gdm_common_warning ("No default session link found. Using Failsafe GNOME.");
- }
-
- if (current_session != NULL &&
- default_session != NULL) {
- if (*current_session == NULL)
- *current_session = *default_session;
- }
-}
-
-static gboolean
-gdm_login_list_lookup (GList *l, const gchar *data)
-{
- GList *list = l;
-
- if (list == NULL || data == NULL)
- return FALSE;
-
- /* FIXME: Hack, will support these builtin types later */
- if (strcmp (data, GDM_SESSION_DEFAULT ".desktop") == 0 ||
- strcmp (data, GDM_SESSION_CUSTOM ".desktop") == 0 ||
- strcmp (data, GDM_SESSION_FAILSAFE ".desktop") == 0) {
- return TRUE;
- }
-
- while (list) {
-
- if (strcmp (list->data, data) == 0)
- return TRUE;
-
- list = list->next;
- }
-
- return FALSE;
-}
-
-char *
-gdm_session_lookup (const char *saved_session, gint *lookup_status)
-{
- gchar *session = NULL;
-
- /* Assume that the lookup will go well */
- *lookup_status = SESSION_LOOKUP_SUCCESS;
-
- /* Don't save session unless told otherwise */
- save_session = GTK_RESPONSE_NO;
-
- /* Previously saved session not found in ~/.dmrc */
- if ( ! (saved_session != NULL &&
- strcmp ("(null)", saved_session) != 0 &&
- saved_session[0] != '\0')) {
- /* If "Last" is chosen run default,
- * else run user's current selection */
- if (current_session == NULL || strcmp (current_session, LAST_SESSION) == 0)
- session = g_strdup (default_session);
- else
- session = g_strdup (current_session);
-
- save_session = GTK_RESPONSE_YES;
- return session;
- }
-
- /* If "Last" session is selected */
- if (current_session == NULL ||
- strcmp (current_session, LAST_SESSION) == 0)
- {
- session = g_strdup (saved_session);
-
- /* Check if user's saved session exists on this box */
- if (!gdm_login_list_lookup (sessions, session))
- {
-
- g_free (session);
- session = g_strdup (default_session);
- *lookup_status = SESSION_LOOKUP_PREFERRED_MISSING;
- }
- }
- else /* One of the other available session types is selected */
- {
- session = g_strdup (current_session);
-
- /* User's saved session is not the chosen one */
- if (strcmp (session, GDM_SESSION_FAILSAFE_GNOME) == 0 ||
- strcmp (session, GDM_SESSION_FAILSAFE_XTERM) == 0 ||
- g_ascii_strcasecmp (session, GDM_SESSION_FAILSAFE ".desktop") == 0 ||
- g_ascii_strcasecmp (session, GDM_SESSION_FAILSAFE) == 0)
- {
- /*
- * Never save failsafe sessions as the default session.
- * These are intended to be used for debugging or temporary
- * purposes.
- */
- save_session = GTK_RESPONSE_NO;
- }
- else if (strcmp (saved_session, session) != 0)
- {
- if (gdm_config_get_bool (GDM_KEY_SHOW_LAST_SESSION))
- {
- *lookup_status = SESSION_LOOKUP_DEFAULT_MISMATCH;
- }
- else if (strcmp (session, default_session) != 0 &&
- strcmp (session, saved_session) != 0 &&
- strcmp (session, LAST_SESSION) != 0)
- {
- /*
- * If (! GDM_KEY_SHOW_LAST_SESSION) then our saved session is
- * irrelevant, we are in "switchdesk mode" and the relevant
- * thing is the saved session in .Xclients
- */
- if (g_access ("/usr/bin/switchdesk", F_OK) == 0)
- {
- *lookup_status = SESSION_LOOKUP_USE_SWITCHDESK;
- }
- save_session = GTK_RESPONSE_NO;
- }
- }
- }
-
- return session;
-}
-
-gint
-gdm_get_save_session (void)
-{
- return save_session;
-}
-
-void
-gdm_set_save_session (const gint session)
-{
- save_session = session;
-}
-
-const char*
-gdm_get_default_session (void)
-{
- return default_session;
-}
diff --git a/gui/gdmsession.h b/gui/gdmsession.h
deleted file mode 100644
index 07c8ddcd..00000000
--- a/gui/gdmsession.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 GDM_SESSION_H
-#define GDM_SESSION_H
-
-#include "misc.h"
-
-#define LAST_SESSION "Last"
-#define SESSION_NAME "SessionName"
-
-typedef struct {
- char *name;
- char *clearname;
- char *comment;
-} GdmSession;
-
-enum {
- SESSION_LOOKUP_SUCCESS,
- SESSION_LOOKUP_PREFERRED_MISSING,
- SESSION_LOOKUP_DEFAULT_MISMATCH,
- SESSION_LOOKUP_USE_SWITCHDESK
-};
-
-void gdm_session_list_init (void);
-void _gdm_session_list_init (GHashTable **sessnames,
- GList **sessions,
- gchar **default_session,
- const gchar **current_session);
-gint gdm_session_sort_func (const char *a, const char *b);
-const char * gdm_session_name (const char *name);
-void gdm_session_list_from_hash_table_func (const char *key,
- const char *value,
- GList **sessions);
-gint gdm_session_sort_func (const char *a,
- const char *b);
-char * gdm_session_lookup (const char *saved_session, gint *lookup_status);
-
-gint gdm_get_save_session (void);
-
-void gdm_set_save_session (const gint session);
-
-const char * gdm_get_default_session (void);
-
-#endif /* GDM_SESSION_H */
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
deleted file mode 100644
index b0d924f7..00000000
--- a/gui/gdmsetup.c
+++ /dev/null
@@ -1,8544 +0,0 @@
-/* GDMSetup
- * Copyright (C) 2002, George Lebl
- *
- * 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 "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <dirent.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <popt.h>
-#include <ctype.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <pwd.h>
-#include <X11/Xmd.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <glade/glade.h>
-#include <glib/gi18n.h>
-
-#include "vicious.h"
-#include "viciousui.h"
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "misc.h"
-#include "gdmcomm.h"
-#include "gdmuser.h"
-#include "gdmsession.h"
-#include "gdmconfig.h"
-
-static char *GdmSoundProgram = NULL;
-static gchar *GdmExclude = NULL;
-static gchar *GdmInclude = NULL;
-static gint GdmIconMaxHeight;
-static gint GdmIconMaxWidth;
-static gboolean GdmIncludeAll;
-static gboolean GdmUserChangesUnsaved;
-static gboolean GdmRandomFromSelectedChangesWarn;
-static gint last_selected_command;
-
-/* set the DOING_GDM_DEVELOPMENT env variable if you want to
- * search for the glade file in the current dir and not the system
- * install dir, better then something you have to change
- * in the source and recompile
- */
-
-static gboolean DOING_GDM_DEVELOPMENT = FALSE;
-static gboolean RUNNING_UNDER_GDM = FALSE;
-static gboolean gdm_running = FALSE;
-static GladeXML *xml;
-static GladeXML *xml_add_users;
-static GladeXML *xml_add_xservers;
-static GladeXML *xml_xdmcp;
-static GladeXML *xml_xservers;
-static GladeXML *xml_commands;
-static GtkWidget *setup_notebook;
-static GList *timeout_widgets = NULL;
-static gchar *last_theme_installed = NULL;
-static char *selected_themes = NULL;
-static char *selected_theme = NULL;
-static gchar *config_file;
-static gchar *custom_config_file;
-static GSList *xservers;
-
-/* This is used to store changes made to all
- possible fields of custom/normal commands */
-static GHashTable *GdmCommandChangesUnsaved = NULL;
-
-/* Used to store all available sessions */
-static GList *sessions = NULL;
-
-enum {
- XSERVER_COLUMN_VT,
- XSERVER_COLUMN_SERVER,
- XSERVER_COLUMN_OPTIONS,
- XSERVER_NUM_COLUMNS
-};
-
-enum {
- THEME_COLUMN_SELECTED,
- THEME_COLUMN_SELECTED_LIST,
- THEME_COLUMN_DIR,
- THEME_COLUMN_FILE,
- THEME_COLUMN_SCREENSHOT,
- THEME_COLUMN_MARKUP,
- THEME_COLUMN_NAME,
- THEME_COLUMN_DESCRIPTION,
- THEME_COLUMN_AUTHOR,
- THEME_COLUMN_COPYRIGHT,
- THEME_NUM_COLUMNS
-};
-
-enum {
- USERLIST_NAME,
- USERLIST_NUM_COLUMNS
-};
-
-enum {
- ONE_THEME,
- RANDOM_THEME
-};
-
-enum {
- GENERAL_TAB,
- LOCAL_TAB,
- REMOTE_TAB,
- ACCESSIBILITY_TAB,
- SECURITY_TAB,
- USERS_TAB
-};
-
-enum {
- CLOCK_AUTO,
- CLOCK_YES,
- CLOCK_NO
-};
-
-enum {
- HALT_CMD,
- REBOOT_CMD,
- SUSPEND_CMD,
- CUSTOM_CMD
-};
-
-enum {
- LOCAL_PLAIN,
- LOCAL_PLAIN_WITH_FACE,
- LOCAL_THEMED
-};
-
-enum {
- REMOTE_DISABLED,
- REMOTE_SAME_AS_LOCAL,
- REMOTE_PLAIN = 2,
- REMOTE_THEMED = 2,
- REMOTE_PLAIN_WITH_FACE = 3
-};
-
-enum {
- XSERVER_LAUNCH_GREETER,
- XSERVER_LAUNCH_CHOOSER
-};
-
-enum {
- BACKGROUND_NONE,
- BACKGROUND_IMAGE_AND_COLOR,
- BACKGROUND_COLOR,
- BACKGROUND_IMAGE
-};
-
-
-static GtkTargetEntry target_table[] = {
- { "text/uri-list", 0, 0 }
-};
-
-static guint n_targets = sizeof (target_table) / sizeof (target_table[0]);
-
-static void
-simple_spawn_sync (char **argv)
-{
- g_spawn_sync (NULL /* working_directory */,
- argv,
- NULL /* envp */,
- G_SPAWN_SEARCH_PATH |
- G_SPAWN_STDOUT_TO_DEV_NULL |
- G_SPAWN_STDERR_TO_DEV_NULL,
- NULL /* child_setup */,
- NULL /* user_data */,
- NULL /* stdout */,
- NULL /* stderr */,
- NULL /* exit status */,
- NULL /* error */);
-}
-
-static void
-setup_cursor (GdkCursorType type)
-{
- GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
- gdk_cursor_unref (cursor);
-}
-
-static void
-setup_window_cursor (GdkCursorType type)
-{
- GdkCursor *cursor = gdk_cursor_new (type);
- GtkWidget *setup_dialog = glade_helper_get
- (xml, "setup_dialog", GTK_TYPE_WINDOW);
- if (setup_dialog->window)
- gdk_window_set_cursor (setup_dialog->window, cursor);
- gdk_cursor_unref (cursor);
-}
-
-static void
-unsetup_window_cursor (void)
-{
- GtkWidget *setup_dialog = glade_helper_get
- (xml, "setup_dialog", GTK_TYPE_WINDOW);
- if (setup_dialog->window)
- gdk_window_set_cursor (setup_dialog->window, NULL);
-}
-
-static void
-update_greeters (void)
-{
- char *p, *ret;
- long pid;
- static gboolean shown_error = FALSE;
- gboolean have_error = FALSE;
-
- /* recheck for gdm */
- gdm_running = gdmcomm_check (FALSE);
-
- if ( ! gdm_running)
- return;
-
- ret = gdmcomm_call_gdm (GDM_SUP_GREETERPIDS,
- NULL /* auth_cookie */,
- "2.3.90.2",
- 5);
- if (ret == NULL)
- return;
- p = strchr (ret, ' ');
- if (p == NULL) {
- g_free (ret);
- return;
- }
- p++;
-
- for (;;) {
- if (sscanf (p, "%ld", &pid) != 1) {
- g_free (ret);
- goto check_update_error;
- }
-
- /* sanity */
- if (pid <= 0)
- continue;
-
- if (kill (pid, SIGHUP) != 0)
- have_error = TRUE;
- p = strchr (p, ';');
- if (p == NULL) {
- g_free (ret);
- goto check_update_error;
- }
- p++;
- }
-
-check_update_error:
- if ( ! shown_error && have_error) {
- GtkWidget *setup_dialog = glade_helper_get
- (xml, "setup_dialog", GTK_TYPE_WINDOW);
- GtkWidget *dlg =
- ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("An error occurred while "
- "trying to contact the "
- "login screens. Not all "
- "updates may have taken "
- "effect."),
- "");
- gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- shown_error = TRUE;
- }
-}
-
-static gboolean
-the_timeout (gpointer data)
-{
- GtkWidget *widget = data;
- gboolean (*func) (GtkWidget *);
-
- func = g_object_get_data (G_OBJECT (widget), "timeout_func");
-
- if ( ! (*func) (widget)) {
- g_object_set_data (G_OBJECT (widget), "change_timeout", NULL);
- g_object_set_data (G_OBJECT (widget), "timeout_func", NULL);
- timeout_widgets = g_list_remove (timeout_widgets, widget);
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-static void
-run_timeout (GtkWidget *widget, guint tm, gboolean (*func) (GtkWidget *))
-{
- guint id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
- "change_timeout"));
- if (id != 0) {
- g_source_remove (id);
- } else {
- timeout_widgets = g_list_prepend (timeout_widgets, widget);
- }
-
- id = g_timeout_add (tm, the_timeout, widget);
- g_object_set_data (G_OBJECT (widget), "timeout_func", func);
-
- g_object_set_data (G_OBJECT (widget), "change_timeout",
- GUINT_TO_POINTER (id));
-}
-
-static void
-update_key (const char *key)
-{
- if (key == NULL)
- return;
-
- /* recheck for gdm */
- gdm_running = gdmcomm_check (FALSE);
-
- if (gdm_running) {
- char *ret;
- char *s = g_strdup_printf ("%s %s", GDM_SUP_UPDATE_CONFIG,
- key);
- ret = gdmcomm_call_gdm (s,
- NULL /* auth_cookie */,
- "2.3.90.2",
- 5);
- g_free (s);
- g_free (ret);
- }
-}
-
-static void
-gdm_setup_config_set_bool (const char *key, gboolean val)
-{
- VeConfig *cfg = ve_config_get (config_file);
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- gboolean defaultval = ve_config_get_bool (cfg, key);
-
- if (val == defaultval) {
- ve_config_delete_key (custom_cfg, key);
- } else {
- ve_config_set_bool (custom_cfg, key, val);
- }
-
- ve_config_save (custom_cfg, FALSE /* force */);
-
- update_key (key);
-}
-
-static void
-gdm_setup_config_set_int (const char *key, int val)
-{
- VeConfig *cfg = ve_config_get (config_file);
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- int defaultval = ve_config_get_int (cfg, key);
-
- if (val == defaultval) {
- ve_config_delete_key (custom_cfg, key);
- } else {
- ve_config_set_int (custom_cfg, key, val);
- }
-
- ve_config_save (custom_cfg, FALSE /* force */);
-
- update_key (key);
-}
-
-static void
-gdm_setup_config_set_string (const char *key, gchar *val)
-{
- VeConfig *cfg = ve_config_get (config_file);
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- gchar *defaultval = ve_config_get_string (cfg, key);
-
- if (defaultval != NULL &&
- strcmp (ve_sure_string (val), ve_sure_string (defaultval)) == 0) {
- ve_config_delete_key (custom_cfg, key);
- } else {
- ve_config_set_string (custom_cfg, key, val);
- }
-
- if (defaultval)
- g_free (defaultval);
-
- ve_config_save (custom_cfg, FALSE /* force */);
-
- update_key (key);
-}
-
-static gboolean
-radiogroup_timeout (GtkWidget *toggle)
-{
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
- GSList *radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (toggle));
-
- if (strcmp (ve_sure_string (key), GDM_KEY_RELAX_PERM) == 0) {
- GSList *tmp;
- gint val;
- gint selected = 0;
- gint i = 0;
- gint list_size;
-
- val = gdm_config_get_int ((gchar *)key);
- list_size = g_slist_length (radio_group) - 1;
-
- for (tmp = radio_group; tmp != NULL; tmp = tmp->next, i++) {
- GtkWidget *radio_button;
- radio_button = (GtkWidget *) tmp->data;
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio_button)))
- selected = list_size - i;
- }
-
- if (val != selected)
- gdm_setup_config_set_int (key, selected);
-
- }
- return FALSE;
-}
-
-static gboolean
-toggle_timeout (GtkWidget *toggle)
-{
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
- gboolean val = gdm_config_get_bool ((gchar *)key);
-
- if (strcmp (ve_sure_string (key), GDM_KEY_ENTRY_INVISIBLE) == 0) {
- /* This is a lil bit back to front
- true is false and false is true in this case */
- if ( ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
- gdm_setup_config_set_bool (key, !GTK_TOGGLE_BUTTON (toggle)->active);
- }
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_GLOBAL_FACE_DIR) == 0) {
- /* Once enabled write the curently selected item
- in the filechooser widget, otherwise disable
- the config entry, i.e. write an empty string */
- if (GTK_TOGGLE_BUTTON (toggle)->active == TRUE) {
- gchar *filename;
- GtkWidget *file_chooser;
-
- file_chooser = glade_helper_get (xml, "global_face_dir_filechooser",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
-
- if (strcmp (ve_sure_string (gdm_config_get_string ((char*)key)),
- ve_sure_string (filename)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (filename));
-
- g_free (filename);
- }
- else
- gdm_setup_config_set_string (key, "");
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_DEFAULT_FACE) == 0) {
- /* Once enabled write the curently selected item
- in the filechooser widget, otherwise disable
- the config entry, i.e. write an empty string */
- if (GTK_TOGGLE_BUTTON (toggle)->active == TRUE) {
- gchar *filename;
- GtkWidget *file_chooser;
-
- file_chooser = glade_helper_get (xml, "default_face_filechooser",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
-
- if (strcmp (ve_sure_string (gdm_config_get_string ((char*)key)),
- ve_sure_string (filename)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (filename));
-
- g_free (filename);
- }
- else
- gdm_setup_config_set_string (key, "");
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_GTKRC) == 0) {
- /* Once enabled write the curently selected item
- in the filechooser widget, otherwise disable
- the config entry, i.e. write an empty string */
- if (GTK_TOGGLE_BUTTON (toggle)->active == TRUE) {
- gchar *filename;
- GtkWidget *file_chooser;
-
- file_chooser = glade_helper_get (xml, "gtkrc_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
-
- if (strcmp (ve_sure_string (gdm_config_get_string ((char*)key)),
- ve_sure_string (filename)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (filename));
-
- g_free (filename);
- }
- else
- gdm_setup_config_set_string (key, "");
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_DEFAULT_SESSION) == 0) {
- /* Once enabled write the curently selected item
- in the combobox widget, otherwise disable
- the config entry, i.e. write an empty string */
-
- if (GTK_TOGGLE_BUTTON (toggle)->active == TRUE) {
- gint selected;
- gchar *value;
- gchar *new_val = NULL;
- GtkWidget *default_session_combobox;
-
- default_session_combobox = glade_helper_get (xml, "default_session_combobox",
- GTK_TYPE_COMBO_BOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (default_session_combobox));
-
- value = gdm_config_get_string ((gchar *)key);
-
- new_val = g_strdup ((gchar*) g_list_nth_data (sessions, selected));
-
- if (strcmp (ve_sure_string (value), ve_sure_string (new_val)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (new_val));
-
- g_free (value);
- g_free (new_val);
- }
- else
- gdm_setup_config_set_string (key, "");
- }
- else {
- /* All other cases */
- if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
- gdm_setup_config_set_bool (key, GTK_TOGGLE_BUTTON (toggle)->active);
- }
- }
-
- return FALSE;
-}
-
-static gboolean
-command_toggle_timeout (GtkWidget *toggle)
-{
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
-
- if (strcmp (ve_sure_string (key), GDM_KEY_CUSTOM_CMD_IS_PERSISTENT_TEMPLATE) == 0 ||
- strcmp (ve_sure_string (key), GDM_KEY_CUSTOM_CMD_NO_RESTART_TEMPLATE) == 0) {
- /* This only applies to custom commands
- First find which command has been ticked on/off then put the new value
- together with the corresponding key into the command changed hash.
- Enable apply command changes button. If command is equal to the existing
- config value remove it from the hash and disable the apply command changes
- button (if applicable) */
-
- gchar *key_string;
- gboolean old_val = FALSE;
- gboolean val;
- GtkWidget *apply_cmd_changes;
- GtkWidget *command_combobox;
- gint selected, i;
-
- val = GTK_TOGGLE_BUTTON (toggle)->active;
- apply_cmd_changes = glade_helper_get (xml_commands, "command_apply_button", GTK_TYPE_BUTTON);
- command_combobox = glade_helper_get (xml_commands,
- "cmd_type_combobox",
- GTK_TYPE_COMBO_BOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (command_combobox));
-
- i = selected - CUSTOM_CMD;
- key_string = g_strdup_printf(_("%s%d="), ve_sure_string (key), i);
- old_val = gdm_config_get_bool (key_string);
-
- if (val != old_val) {
- gboolean *p_val = g_new0 (gboolean, 1);
- *p_val = val;
- g_hash_table_insert (GdmCommandChangesUnsaved, g_strdup (key_string), p_val);
- }
- else if (g_hash_table_lookup (GdmCommandChangesUnsaved, key_string) != NULL) {
- g_hash_table_remove (GdmCommandChangesUnsaved, key_string);
- }
-
- g_free (key_string);
-
- if (g_hash_table_size (GdmCommandChangesUnsaved) == 0)
- gtk_widget_set_sensitive (apply_cmd_changes, FALSE);
- else
- gtk_widget_set_sensitive (apply_cmd_changes, TRUE);
- }
-
- return FALSE;
-}
-
-static gboolean
-logo_toggle_timeout (GtkWidget *toggle)
-{
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
- GtkWidget *chooserbutton;
- gchar *filename;
-
- chooserbutton = glade_helper_get (xml, "local_logo_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooserbutton));
-
- if ((GTK_TOGGLE_BUTTON (toggle)->active) == FALSE) {
- gdm_setup_config_set_string (GDM_KEY_CHOOSER_BUTTON_LOGO, filename);
- gdm_setup_config_set_string (key, "");
- }
- else if (filename != NULL) {
- gdm_setup_config_set_string (GDM_KEY_CHOOSER_BUTTON_LOGO, filename);
- gdm_setup_config_set_string (key, filename);
- }
- update_greeters ();
- g_free (filename);
- return FALSE;
-}
-
-static void
-logo_toggle_toggled (GtkWidget *toggle, gpointer data)
-{
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
-
- GtkWidget *checkbutton;
-
- checkbutton = glade_helper_get (xml, "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- g_signal_handlers_disconnect_by_func (checkbutton,
- (gpointer) logo_toggle_toggled,
- NULL);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton),
- GTK_TOGGLE_BUTTON (toggle)->active);
-
- g_signal_connect (G_OBJECT (checkbutton), "toggled",
- G_CALLBACK (logo_toggle_toggled), NULL);
- }
- else {
- GtkWidget *checkbutton;
-
- checkbutton = glade_helper_get (xml, "local_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- g_signal_handlers_disconnect_by_func (checkbutton,
- (gpointer) logo_toggle_toggled,
- NULL);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton),
- GTK_TOGGLE_BUTTON (toggle)->active);
-
- g_signal_connect (G_OBJECT (checkbutton), "toggled",
- G_CALLBACK (logo_toggle_toggled), NULL);
- }
- run_timeout (toggle, 200, logo_toggle_timeout);
-}
-
-/* Forward declarations */
-static void
-setup_user_combobox_list (const char *name, const char *key);
-static char *
-strings_list_add (char *strings_list, const char *string, const char *sep);
-static char *
-strings_list_remove (char *strings_list, const char *string, const char *sep);
-
-static gboolean
-intspin_timeout (GtkWidget *spin)
-{
- const char *key = g_object_get_data (G_OBJECT (spin), "key");
- int new_val = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
- int val;
- gboolean greeters_need_update = FALSE;
-
- val = gdm_config_get_int ((gchar *)key);
-
- if (strcmp (ve_sure_string (key), GDM_KEY_MINIMAL_UID) == 0){
- /* We have changed MinimalUID, so we need to go through
- the list of existing users in the Include list and remove
- the entries that do not match the criteria anymore. If there
- are any user is informed about the changes. Auto login and
- timed login comboboxes are adjusted and greeters restarted */
- char **list;
- char *removed = NULL;
- int i;
- gchar *autologon_user;
- gchar *timedlogon_user;
-
-
- list = g_strsplit (GdmInclude, ",", 0);
- for (i=0; list != NULL && list[i] != NULL; i++) {
- if (gdm_user_uid (list[i]) >= new_val)
- continue;
-
- GdmInclude = strings_list_remove (GdmInclude, list[i], ",");
- removed = strings_list_add(removed, list[i], ",");
-
- }
- g_strfreev (list);
-
- //Now if there were items to remove then
- if (removed != NULL) {
- gboolean valid;
- gchar *text;
- GtkWidget *include_treeview;
- GtkTreeModel *include_model;
- GtkWidget *dlg;
- GtkTreeIter iter;
- GtkWidget *setup_dialog;
-
- setup_dialog = glade_helper_get(xml, "setup_dialog", GTK_TYPE_WINDOW);
-
- //Inform user about the change and its implications
- dlg = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Users include list modification"),
- _("Some of the users in the Include list "
- "(Users tab) now have uid lower than "
- "MinimalUID and will be removed."));
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
-
- include_treeview = glade_helper_get (xml, "fb_include_treeview",
- GTK_TYPE_TREE_VIEW);
- include_model = gtk_tree_view_get_model (GTK_TREE_VIEW (include_treeview));
-
- valid = gtk_tree_model_get_iter_first (include_model, &iter);
- while (valid) {
- gtk_tree_model_get (include_model, &iter, USERLIST_NAME,
- &text, -1);
-
- if (strstr (removed, text) != NULL) {
- valid = gtk_list_store_remove (GTK_LIST_STORE (include_model), &iter);
- }
- else {
- valid = gtk_tree_model_iter_next (include_model, &iter);
- }
- }
- g_free (text);
- /* Now we need to save updated list, toggle the
- automatic and timed loggon comboboxes and update greeters */
- gdm_setup_config_set_string (GDM_KEY_INCLUDE, GdmInclude);
-
- greeters_need_update = TRUE;
-
- }
-
- g_free (removed);
-
- /* We also need to check if user (if any) in the
- autologon/timed logon still match the criteria */
- autologon_user = gdm_config_get_string (GDM_KEY_AUTOMATIC_LOGIN);
- timedlogon_user = gdm_config_get_string (GDM_KEY_TIMED_LOGIN);
-
- if(!ve_string_empty (autologon_user)) {
- if (gdm_is_user_valid (autologon_user) && gdm_user_uid (autologon_user) < new_val) {
- gdm_setup_config_set_string (GDM_KEY_AUTOMATIC_LOGIN, "");
- greeters_need_update = TRUE;
- }
- }
-
- if(!ve_string_empty (timedlogon_user)) {
- if (gdm_is_user_valid (timedlogon_user) && gdm_user_uid (timedlogon_user) < new_val) {
- gdm_setup_config_set_string (GDM_KEY_TIMED_LOGIN, "");
- greeters_need_update = TRUE;
- }
- }
-
- g_free (autologon_user);
- g_free (timedlogon_user);
-
- }
-
- if (val != new_val)
- gdm_setup_config_set_int (key, new_val);
-
- if (greeters_need_update) {
- setup_user_combobox_list ("autologin_combo",
- GDM_KEY_AUTOMATIC_LOGIN);
- setup_user_combobox_list ("timedlogin_combo",
- GDM_KEY_TIMED_LOGIN);
- update_greeters ();
- }
-
- return FALSE;
-}
-
-static gint
-display_sort_func (gpointer d1, gpointer d2)
-{
- return (strcmp (ve_sure_string ((gchar *)d1), ve_sure_string ((gchar *)d2)));
-}
-
-static GSList *displays = NULL;
-static GSList *displays_inactive = NULL;
-static GHashTable *dispval_hash = NULL;
-
-static void
-gdm_load_displays (VeConfig *cfg, GList *list )
-{
- GList *li;
- GSList *li2;
-
- for (li = list; li != NULL; li = li->next) {
- const gchar *key = li->data;
-
- if (isdigit (*key)) {
- gchar *fullkey;
- gchar *dispval;
- int keynum = atoi (key);
- gboolean skip_entry = FALSE;
-
- fullkey = g_strdup_printf ("%s/%s", GDM_KEY_SECTION_SERVERS, key);
- dispval = ve_config_get_string (cfg, fullkey);
- g_free (fullkey);
-
- /* Do not add if already in the list */
- for (li2 = displays; li2 != NULL; li2 = li2->next) {
- gchar *disp = li2->data;
- if (atoi (disp) == keynum) {
- skip_entry = TRUE;
- break;
- }
- }
-
- /* Do not add if this display was marked as inactive already */
- for (li2 = displays_inactive; li2 != NULL; li2 = li2->next) {
- gchar *disp = li2->data;
- if (atoi (disp) == keynum) {
- skip_entry = TRUE;
- break;
- }
- }
-
- if (skip_entry == TRUE) {
- g_free (dispval);
- continue;
- }
-
- if (g_ascii_strcasecmp (ve_sure_string (dispval), "inactive") == 0) {
- displays_inactive = g_slist_append (displays_inactive, g_strdup (key));
- } else {
- if (dispval_hash == NULL)
- dispval_hash = g_hash_table_new (g_str_hash, g_str_equal);
-
- displays = g_slist_insert_sorted (displays, g_strdup (key), (GCompareFunc) display_sort_func);
- g_hash_table_insert (dispval_hash, g_strdup (key), g_strdup (dispval));
- }
-
- g_free (dispval);
- }
- }
-}
-
-static void
-xservers_get_displays (GtkListStore *store)
-{
- /* Find server definitions */
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- VeConfig *cfg = ve_config_get (config_file);
- GList *list;
- GSList *li;
- gchar *server, *options;
-
- /* Fill list with all the active displays */
- if (custom_cfg) {
- list = ve_config_get_keys (custom_cfg, GDM_KEY_SECTION_SERVERS);
- gdm_load_displays (custom_cfg, list);
- ve_config_free_list_of_strings (list);
- }
- list = ve_config_get_keys (cfg, GDM_KEY_SECTION_SERVERS);
- gdm_load_displays (cfg, list);
- ve_config_free_list_of_strings (list);
-
- for (li = displays; li != NULL; li = li->next) {
- GtkTreeIter iter;
- gchar *key = li->data;
- int vt = atoi (key);
- server = ve_first_word (g_hash_table_lookup (dispval_hash, key));
- options = ve_rest (g_hash_table_lookup (dispval_hash, key));
-
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- XSERVER_COLUMN_VT, vt,
- XSERVER_COLUMN_SERVER, server,
- XSERVER_COLUMN_OPTIONS, options,
- -1);
- g_free (server);
- }
- for (li = displays; li != NULL; li = li->next) {
- gchar *disp = li->data;
- g_free (disp);
- }
- g_slist_free (displays);
- displays = NULL;
- for (li = displays_inactive; li != NULL; li = li->next) {
- gchar *disp = li->data;
- g_free (disp);
- }
- g_slist_free (displays_inactive);
- displays_inactive = NULL;
- if (dispval_hash) {
- g_hash_table_destroy (dispval_hash);
- dispval_hash = NULL;
- }
-}
-
-static void
-xserver_update_delete_sensitivity ()
-{
- GtkWidget *modify_combobox, *delete_button;
- GtkListStore *store;
- GtkTreeIter iter;
- GdmXserver *xserver;
- gchar *text;
- gchar *selected;
- gboolean valid;
- gint i;
-
- modify_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- delete_button = glade_helper_get (xml_xservers, "xserver_deletebutton",
- GTK_TYPE_BUTTON);
-
- /* Get list of servers that are set to start */
- store = gtk_list_store_new (XSERVER_NUM_COLUMNS,
- G_TYPE_INT /* virtual terminal */,
- G_TYPE_STRING /* server type */,
- G_TYPE_STRING /* options */);
-
- /* Get list of servers and determine which one was selected */
- xservers_get_displays (store);
-
- i = gtk_combo_box_get_active (GTK_COMBO_BOX (modify_combobox));
- if (i < 0) {
- gtk_widget_set_sensitive(delete_button, FALSE);
- } else {
- /* Get the xserver selected */
- xserver = g_slist_nth_data (xservers, i);
-
- /* Sensitivity of delete_button */
- if (g_slist_length (xservers) <= 1) {
- /* Can't delete the last server */
- gtk_widget_set_sensitive (delete_button, FALSE);
- } else {
- gtk_widget_set_sensitive (delete_button, TRUE);
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store),
- &iter);
- selected = gtk_combo_box_get_active_text (
- GTK_COMBO_BOX (modify_combobox));
-
- /* Can't delete servers currently in use */
- while (valid) {
- gtk_tree_model_get (GTK_TREE_MODEL (store), &iter,
- XSERVER_COLUMN_SERVER, &text, -1);
- if (strcmp (ve_sure_string (text), ve_sure_string (selected)) == 0) {
- gtk_widget_set_sensitive(delete_button, FALSE);
- break;
- }
- valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store),
- &iter);
- }
- }
- }
-}
-
-static
-void init_servers_combobox (int index)
-{
- GtkWidget *mod_combobox;
- GtkWidget *name_entry;
- GtkWidget *command_entry;
- GtkWidget *style_combobox;
- GtkWidget *handled_checkbutton;
- GtkWidget *flexible_checkbutton;
- GtkWidget *priority_spinbutton;
- GtkListStore *store;
- GdmXserver *xserver;
-
- mod_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- name_entry = glade_helper_get (xml_xservers, "xserver_name_entry",
- GTK_TYPE_ENTRY);
- command_entry = glade_helper_get (xml_xservers, "xserver_command_entry",
- GTK_TYPE_ENTRY);
- style_combobox = glade_helper_get (xml_xservers, "xserver_style_combobox",
- GTK_TYPE_COMBO_BOX);
- handled_checkbutton = glade_helper_get (xml_xservers, "xserver_handled_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- flexible_checkbutton = glade_helper_get (xml_xservers, "xserver_flexible_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- priority_spinbutton = glade_helper_get(xml_xservers, "xserv_priority_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
-
- /* Get list of servers that are set to start */
- store = gtk_list_store_new (XSERVER_NUM_COLUMNS,
- G_TYPE_INT /* virtual terminal */,
- G_TYPE_STRING /* server type */,
- G_TYPE_STRING /* options */);
- xservers_get_displays (store);
-
- xserver = g_slist_nth_data (xservers, index);
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (mod_combobox), index);
- gtk_entry_set_text (GTK_ENTRY (name_entry), xserver->name);
- gtk_entry_set_text (GTK_ENTRY (command_entry), xserver->command);
-
- if (!xserver->chooser) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (style_combobox), XSERVER_LAUNCH_GREETER);
- }
- else {
- gtk_combo_box_set_active (GTK_COMBO_BOX (style_combobox), XSERVER_LAUNCH_CHOOSER);
- }
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (priority_spinbutton),
- xserver->priority);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (handled_checkbutton),
- xserver->handled);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flexible_checkbutton),
- xserver->flexible);
-
- xserver_update_delete_sensitivity ();
-}
-
-static void
-update_remote_sensitivity (gboolean value)
-{
- GtkWidget *remote_background_color_hbox;
- GtkWidget *remote_background_image_hhox;
- GtkWidget *remote_background_image_checkbutton;
- GtkWidget *remote_background_image_chooserbutton;
- GtkWidget *remote_logo_image_checkbutton;
- GtkWidget *remote_plain_logo_hbox;
- GtkWidget *remote_theme_background_hbox;
- GtkWidget *remote_theme_mode_hbox;
- GtkWidget *remote_theme_select_hbox;
- GtkWidget *sg_scale_background_remote_hbox;
-
- remote_background_color_hbox = glade_helper_get (xml, "remote_background_color_hbox",
- GTK_TYPE_HBOX);
- remote_background_image_hhox = glade_helper_get (xml, "remote_background_image_hhox",
- GTK_TYPE_HBOX);
- remote_background_image_checkbutton = glade_helper_get (xml, "remote_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- remote_background_image_chooserbutton = glade_helper_get (xml, "remote_background_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- remote_logo_image_checkbutton = glade_helper_get (xml, "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- remote_plain_logo_hbox = glade_helper_get (xml, "remote_plain_logo_hbox",
- GTK_TYPE_HBOX);
- remote_theme_background_hbox = glade_helper_get (xml, "remote_theme_background_hbox",
- GTK_TYPE_TABLE);
- remote_theme_mode_hbox = glade_helper_get (xml, "remote_theme_mode_hbox",
- GTK_TYPE_HBOX);
- remote_theme_select_hbox = glade_helper_get (xml, "remote_theme_select_hbox",
- GTK_TYPE_HBOX);
- sg_scale_background_remote_hbox = glade_helper_get (xml, "sg_scale_background_remote_hbox",
- GTK_TYPE_HBOX);
-
- gtk_widget_set_sensitive (remote_background_color_hbox, value);
- gtk_widget_set_sensitive (remote_background_image_hhox, value);
- gtk_widget_set_sensitive (remote_background_image_checkbutton, value);
- gtk_widget_set_sensitive (remote_background_image_chooserbutton, value);
- gtk_widget_set_sensitive (remote_logo_image_checkbutton, value);
- gtk_widget_set_sensitive (remote_plain_logo_hbox, value);
- gtk_widget_set_sensitive (remote_theme_background_hbox, value);
- gtk_widget_set_sensitive (remote_theme_mode_hbox, value);
- gtk_widget_set_sensitive (remote_theme_select_hbox, value);
- gtk_widget_set_sensitive (sg_scale_background_remote_hbox, value);
-}
-
-static void
-refresh_remote_tab (void)
-{
- GtkWidget *local_greeter;
- GtkWidget *remote_greeter;
- GtkWidget *remote_plain_vbox;
- GtkWidget *remote_themed_vbox;
- GtkWidget *configure_xdmcp_vbox;
- GtkWidget *welcome_message_vbox;
- GtkWidget *allowremoteroot;
- GtkWidget *allowremoteauto;
- gchar *remote_style;
- gint local_style;
-
- local_greeter = glade_helper_get (xml, "local_greeter",
- GTK_TYPE_COMBO_BOX);
- remote_greeter = glade_helper_get (xml, "remote_greeter",
- GTK_TYPE_COMBO_BOX);
- remote_plain_vbox = glade_helper_get (xml, "remote_plain_properties_vbox",
- GTK_TYPE_VBOX);
- remote_themed_vbox = glade_helper_get (xml, "remote_themed_properties_vbox",
- GTK_TYPE_VBOX);
- configure_xdmcp_vbox = glade_helper_get (xml, "remote_configure_xdmcp_vbox",
- GTK_TYPE_VBOX);
- welcome_message_vbox = glade_helper_get (xml, "remote_welcome_message_vbox",
- GTK_TYPE_VBOX);
- allowremoteroot = glade_helper_get (xml, "allowremoteroot",
- GTK_TYPE_BUTTON);
- allowremoteauto = glade_helper_get (xml, "allowremoteauto",
- GTK_TYPE_CHECK_BUTTON);
-
- /* Remove previously added items from the combobox */
- gtk_combo_box_remove_text (GTK_COMBO_BOX (remote_greeter), REMOTE_PLAIN_WITH_FACE);
- gtk_combo_box_remove_text (GTK_COMBO_BOX (remote_greeter), REMOTE_PLAIN);
-
- local_style = gtk_combo_box_get_active (GTK_COMBO_BOX (local_greeter));
- remote_style = gdm_config_get_string (GDM_KEY_REMOTE_GREETER);
-
- if (gdm_config_get_bool (GDM_KEY_XDMCP) == FALSE) {
-
- if (local_style == LOCAL_PLAIN || local_style == LOCAL_PLAIN_WITH_FACE) {
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Themed"));
- }
- else {
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Plain"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Plain with face browser"));
- }
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_DISABLED);
- gtk_widget_set_sensitive (allowremoteroot, FALSE);
- gtk_widget_set_sensitive (allowremoteauto, FALSE);
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_hide (welcome_message_vbox);
- gtk_widget_hide (configure_xdmcp_vbox);
- }
- else {
- if (local_style == LOCAL_PLAIN || local_style == LOCAL_PLAIN_WITH_FACE) {
-
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Themed"));
-
- if (strstr (remote_style, "/gdmlogin") != NULL) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_SAME_AS_LOCAL);
- update_remote_sensitivity (FALSE);
- gtk_widget_show (remote_plain_vbox);
- gtk_widget_hide (remote_themed_vbox);
- }
- else if (strstr (remote_style, "/gdmgreeter") != NULL) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_THEMED);
- update_remote_sensitivity (TRUE);
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_show (remote_themed_vbox);
- }
- }
- else {
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Plain"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (remote_greeter), _("Plain with face browser"));
-
- if (strstr (remote_style, "/gdmlogin") != NULL) {
- gboolean use_browser;
-
- use_browser = gdm_config_get_bool (GDM_KEY_BROWSER);
- if (use_browser == FALSE) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_PLAIN);
- }
- else {
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_PLAIN_WITH_FACE);
- }
- update_remote_sensitivity (TRUE);
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_show (remote_plain_vbox);
- }
- else if (strstr (remote_style, "/gdmgreeter") != NULL) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (remote_greeter), REMOTE_SAME_AS_LOCAL);
- update_remote_sensitivity (FALSE);
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_show (remote_themed_vbox);
- }
- }
- gtk_widget_set_sensitive (allowremoteauto, gdm_config_get_bool (GDM_KEY_XDMCP));
- gtk_widget_set_sensitive (allowremoteroot, TRUE);
- gtk_widget_show (welcome_message_vbox);
- gtk_widget_show (configure_xdmcp_vbox);
- }
-}
-
-/*
- * We probably should check the server definition in the defaults.conf file
- * and just erase the section if the values are the same, like we do for the
- * displays section and the normal configuration sections.
- */
-static void
-update_xserver (gchar *section, GdmXserver *svr)
-{
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- gchar *real_section = g_strdup_printf ("%s%s",
- GDM_KEY_SERVER_PREFIX, section);
- gchar *key;
-
- key = g_strconcat (real_section, "/" GDM_KEY_SERVER_NAME, NULL);
- ve_config_set_string (custom_cfg, key, svr->name);
- g_free (key);
-
- key = g_strconcat (real_section, "/" GDM_KEY_SERVER_COMMAND, NULL);
- ve_config_set_string (custom_cfg, key, svr->command);
- g_free (key);
-
- key = g_strconcat (real_section, "/", GDM_KEY_SERVER_CHOOSER, NULL);
- ve_config_set_bool (custom_cfg, key, svr->chooser);
- g_free (key);
-
- key = g_strconcat (real_section, "/" GDM_KEY_SERVER_HANDLED, NULL);
- ve_config_set_bool (custom_cfg, key, svr->handled);
- g_free (key);
-
- key = g_strconcat (real_section, "/" GDM_KEY_SERVER_FLEXIBLE, NULL);
- ve_config_set_bool (custom_cfg, key, svr->flexible);
- g_free (key);
-
- key = g_strconcat (real_section, "/" GDM_KEY_SERVER_PRIORITY, NULL);
- ve_config_set_int (custom_cfg, key, svr->priority);
- g_free (key);
-
- g_free (real_section);
- ve_config_save (custom_cfg, FALSE);
-
- update_key ("xservers/PARAMETERS");
-}
-
-static gboolean
-combobox_timeout (GtkWidget *combo_box)
-{
- const char *key = g_object_get_data (G_OBJECT (combo_box), "key");
- int selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combo_box));
-
- /* Local Greeter Comboboxes */
- if (strcmp (ve_sure_string (key), GDM_KEY_GREETER) == 0) {
-
- gchar *old_key_val;
- gchar *new_key_val;
- gboolean browser_val;
-
- old_key_val = gdm_config_get_string ((gchar *)key);
- new_key_val = NULL;
-
- if (selected == LOCAL_PLAIN_WITH_FACE) {
- new_key_val = g_strdup (LIBEXECDIR "/gdmlogin");
- browser_val = TRUE;
- }
- else if (selected == LOCAL_THEMED) {
- new_key_val = g_strdup (LIBEXECDIR "/gdmgreeter");
- browser_val = gdm_config_get_bool (GDM_KEY_BROWSER);
- }
- else { /* Plain style */
- new_key_val = g_strdup (LIBEXECDIR "/gdmlogin");
- browser_val = FALSE;
- }
-
- if (new_key_val &&
- strcmp (ve_sure_string (old_key_val), ve_sure_string (new_key_val)) != 0) {
-
- gdm_setup_config_set_string (key, new_key_val);
- gdm_setup_config_set_bool (GDM_KEY_BROWSER, browser_val);
- }
- else {
- gdm_setup_config_set_bool (GDM_KEY_BROWSER, browser_val);
- }
- update_greeters ();
-
- refresh_remote_tab ();
- g_free (new_key_val);
- }
- /* Remote Greeter Comboboxes */
- else if (strcmp (ve_sure_string (key), GDM_KEY_REMOTE_GREETER) == 0) {
-
- if (selected == REMOTE_DISABLED) {
- gdm_setup_config_set_bool (GDM_KEY_XDMCP, FALSE);
- } else {
- gchar *new_key_val = NULL;
- gboolean free_new_val = TRUE;
-
- if (selected == REMOTE_SAME_AS_LOCAL) {
- new_key_val = gdm_config_get_string (GDM_KEY_GREETER);
- free_new_val = FALSE;
- }
- else if (selected == REMOTE_PLAIN_WITH_FACE) {
- new_key_val = g_strdup (LIBEXECDIR "/gdmlogin");
- gdm_setup_config_set_bool (GDM_KEY_BROWSER, TRUE);
- }
- else {
- gchar *selected_text;
-
- selected_text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box));
-
- if (strcmp (ve_sure_string (selected_text), _("Themed")) == 0) {
- new_key_val = g_strdup (LIBEXECDIR "/gdmgreeter");
- }
- else {
- new_key_val = g_strdup (LIBEXECDIR "/gdmlogin");
- gdm_setup_config_set_bool (GDM_KEY_BROWSER, FALSE);
- }
- g_free (selected_text);
- }
-
- gdm_setup_config_set_string (key, new_key_val);
- gdm_setup_config_set_bool (GDM_KEY_XDMCP, TRUE);
- if (free_new_val)
- g_free (new_key_val);
- }
- update_greeters ();
- return FALSE;
-
- /* Automatic Login Combobox */
- } else if (strcmp (ve_sure_string (key), GDM_KEY_AUTOMATIC_LOGIN) == 0 ||
- strcmp (ve_sure_string (key), GDM_KEY_TIMED_LOGIN) == 0) {
-
- GtkTreeIter iter;
- char *new_val = NULL;
- gchar *val;
-
- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box),
- &iter)) {
- gtk_tree_model_get (gtk_combo_box_get_model (
- GTK_COMBO_BOX (combo_box)), &iter,
- 0, &new_val, -1);
- }
- else {
- /* The selection was typed so there are two possibilities
- 1. The typed value is a user
- 2. The typed value is a script, garbage, ete (anything but an
- existing user)
- If its case 1. then we check if the user matches the MinimalUID
- criteria or is not root. If its case 2. we do not do any checking */
-
- new_val = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box));
- if (gdm_is_user_valid (ve_sure_string (new_val))) {
- gint user_uid = gdm_user_uid (new_val);
- gint GdmMinimalUID = gdm_config_get_int (GDM_KEY_MINIMAL_UID);
-
- if (user_uid == 0 || user_uid < GdmMinimalUID) {
- /* we can't accept users that have uid lower
- than minimal uid, or uid = 0 (root) */
- gchar *str;
- GtkWidget *dialog;
- GtkWidget *setup_dialog;
-
- if (gdm_user_uid (new_val) == 0)
- str = g_strdup (_("Autologin or timed login to the root account is forbidden."));
- else
- str = g_strdup_printf (_("The \"%s\" user UID is lower than allowed MinimalUID."), new_val);
- setup_dialog = glade_helper_get(xml, "setup_dialog", GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("User not allowed"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
- return TRUE;
- }
- }
- }
-
-
- val = gdm_config_get_string ((gchar *)key);
- if (new_val &&
- strcmp (ve_sure_string (val), ve_sure_string (new_val)) != 0) {
-
- gdm_setup_config_set_string (key, new_val);
- }
- g_free (new_val);
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_GRAPHICAL_THEME_RAND) == 0 ) {
-
- /* Theme Combobox */
- gboolean new_val;
- gboolean old_val ;
-
- old_val = gdm_config_get_bool ((gchar *)key);
-
- /* Choose to display radio or checkbox toggle column.
- We will only set this option to true if there is at least one
- item in the selected_themes list otherwise Random from selected
- will be disabled */
- if (selected == RANDOM_THEME && !ve_string_empty (selected_themes))
- new_val = TRUE;
- else /* Default to one theme */
- new_val = FALSE;
-
- /* Update config */
- if (new_val != old_val)
- gdm_setup_config_set_bool (key, new_val);
- }
- /* Style combobox */
- else if (strcmp (ve_sure_string (key), GDM_KEY_SERVER_CHOOSER) == 0) {
- GtkWidget *mod_combobox;
- GtkWidget *style_combobox;
- GSList *li;
- gchar *section;
- gboolean val_old, val_new;
-
- mod_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- style_combobox = glade_helper_get (xml_xservers, "xserver_style_combobox",
- GTK_TYPE_COMBO_BOX);
-
- /* Get xserver section to update */
- section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (mod_combobox));
-
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
- if (strcmp (ve_sure_string (svr->id), ve_sure_string (section)) == 0) {
-
- val_old = svr->chooser;
- val_new = (gtk_combo_box_get_active (GTK_COMBO_BOX (style_combobox)) != 0);
-
- /* Update this servers configuration */
- if (! ve_bool_equal (val_old, val_new)) {
- svr->chooser = val_new;
- update_xserver (section, svr);
- }
- break;
- }
- }
- g_free (section);
- }
- /* Use 24 clock combobox */
- else if (strcmp (ve_sure_string (key), GDM_KEY_USE_24_CLOCK) == 0) {
- gchar *val;
- gchar *new_val;
-
- new_val = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo_box));
- val = gdm_config_get_string ((gchar *)key);
- if (new_val &&
- strcmp (ve_sure_string (val), ve_sure_string (new_val)) != 0) {
- gdm_setup_config_set_string (key, new_val);
- }
- g_free (new_val);
- g_free (val);
- }
- /* Commands combobox */
- else if (strcmp (ve_sure_string (key), _("command_chooser_combobox")) == 0) {
- /* We need to set the data according to selected command */
- GtkWidget *hrs_cmd_entry = NULL;
- GtkWidget *cust_cmd_entry = NULL;
- GtkWidget *cust_cmd_label_entry = NULL;
- GtkWidget *cust_cmd_lrlabel_entry = NULL;
- GtkWidget *cust_cmd_text_entry = NULL;
- GtkWidget *cust_cmd_tooltip_entry = NULL;
- GtkWidget *cust_cmd_persistent_checkbox = NULL;
- GtkWidget *cust_cmd_norestart_checkbox = NULL;
- GtkWidget *status_label;
- gchar *val = NULL;
- gboolean bool_val = FALSE;
- gboolean enabled_command = FALSE;
-
- hrs_cmd_entry = glade_helper_get (xml_commands, "hrs_cmd_path_entry",
- GTK_TYPE_ENTRY);
- cust_cmd_entry = glade_helper_get (xml_commands, "custom_cmd_path_entry",
- GTK_TYPE_ENTRY);
- status_label = glade_helper_get (xml_commands, "command_status_label",
- GTK_TYPE_LABEL);
-
- if (selected == HALT_CMD) {
- val = gdm_config_get_string (GDM_KEY_HALT);
- gtk_entry_set_text (GTK_ENTRY (hrs_cmd_entry), ve_sure_string (val));
- enabled_command = !ve_string_empty (val);
- }
- else if (selected == REBOOT_CMD) {
- val = gdm_config_get_string (GDM_KEY_REBOOT);
- gtk_entry_set_text (GTK_ENTRY (hrs_cmd_entry), ve_sure_string (val));
- enabled_command = !ve_string_empty (val);
- }
- else if (selected == SUSPEND_CMD) {
- val = gdm_config_get_string (GDM_KEY_SUSPEND);
- gtk_entry_set_text (GTK_ENTRY (hrs_cmd_entry), ve_sure_string (val));
- enabled_command = !ve_string_empty (val);
- }
- else {
- gchar *key_string = NULL;
-
- gint i = selected - CUSTOM_CMD;
- /* Here we are going to deal with custom commands */
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- val = gdm_config_get_string (key_string);
- gtk_entry_set_text (GTK_ENTRY (cust_cmd_entry), ve_sure_string (val));
- enabled_command = !ve_string_empty (val);
- g_free (key_string);
- g_free (val);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- cust_cmd_label_entry = glade_helper_get (xml_commands, "custom_cmd_label_entry",
- GTK_TYPE_ENTRY);
- val = gdm_config_get_string (key_string);
- gtk_entry_set_text (GTK_ENTRY (cust_cmd_label_entry), ve_sure_string (val));
- g_free (key_string);
- g_free (val);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- cust_cmd_lrlabel_entry = glade_helper_get (xml_commands, "custom_cmd_lrlabel_entry",
- GTK_TYPE_ENTRY);
- val = gdm_config_get_string (key_string);
- gtk_entry_set_text (GTK_ENTRY (cust_cmd_lrlabel_entry), ve_sure_string (val));
- g_free (key_string);
- g_free (val);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, i);
- cust_cmd_text_entry = glade_helper_get (xml_commands, "custom_cmd_text_entry",
- GTK_TYPE_ENTRY);
- val = gdm_config_get_string (key_string);
- gtk_entry_set_text (GTK_ENTRY (cust_cmd_text_entry), ve_sure_string (val));
- g_free (key_string);
- g_free (val);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- cust_cmd_tooltip_entry = glade_helper_get (xml_commands, "custom_cmd_tooltip_entry",
- GTK_TYPE_ENTRY);
- val = gdm_config_get_string (key_string);
- gtk_entry_set_text (GTK_ENTRY (cust_cmd_tooltip_entry), ve_sure_string (val));
- g_free (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_NO_RESTART_TEMPLATE, i);
- cust_cmd_norestart_checkbox = glade_helper_get (xml_commands, "custom_cmd_norestart_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- bool_val = gdm_config_get_bool (key_string);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cust_cmd_norestart_checkbox), bool_val);
- g_free (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_IS_PERSISTENT_TEMPLATE, i);
- cust_cmd_persistent_checkbox = glade_helper_get (xml_commands, "custom_cmd_persistent_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- bool_val = gdm_config_get_bool (key_string);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (cust_cmd_persistent_checkbox), bool_val);
- g_free (key_string);
-
- }
- g_free (val);
-
- if (enabled_command)
- gtk_label_set_text (GTK_LABEL (status_label), _("(Enabled)"));
- else
- gtk_label_set_text (GTK_LABEL (status_label), _("(Disabled)"));
- }
- /* Default session combobox*/
- else if (strcmp (ve_sure_string (key), GDM_KEY_DEFAULT_SESSION) == 0) {
- /* First we get the selected index. Next we lookup the actual
- filename in the List of sessions */
- gchar *val;
- gchar *new_val = NULL;
-
- val = gdm_config_get_string ((gchar *)key);
- new_val = g_strdup ((gchar*) g_list_nth_data (sessions, selected));
-
- if (strcmp (ve_sure_string (val), ve_sure_string (new_val)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (new_val));
-
- g_free (new_val);
- g_free (val);
- }
- return FALSE;
-}
-
-static void
-toggle_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 200, toggle_timeout);
-}
-
-static void
-command_toggle_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 200, command_toggle_timeout);
-}
-
-static void
-radiogroup_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 200, radiogroup_timeout);
-}
-
-static void
-list_selection_toggled (GtkWidget *toggle, gpointer data)
-{
- GtkWidget *widget = data;
- GtkWidget *include_treeview;
- GtkTreeSelection *selection;
- GtkTreeModel *include_model;
- GtkTreeIter iter;
- gboolean val;
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
-
- include_treeview = glade_helper_get (xml, "fb_include_treeview",
- GTK_TYPE_TREE_VIEW);
- include_model = gtk_tree_view_get_model (GTK_TREE_VIEW (include_treeview));
-
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (include_treeview));
-
- if ((val == FALSE) && (gtk_tree_selection_get_selected (selection, &(include_model), &iter))) {
- gtk_widget_set_sensitive (widget, TRUE);
- } else {
- gtk_widget_set_sensitive (widget, FALSE);
- }
-
- run_timeout (toggle, 200, toggle_timeout);
-}
-
-static void
-intspin_changed (GtkWidget *spin)
-{
- run_timeout (spin, 500, intspin_timeout);
-}
-
-static void
-combobox_changed (GtkWidget *combobox)
-{
- const char *key = g_object_get_data (G_OBJECT (combobox), "key");
-
- if (strcmp (ve_sure_string (key), GDM_KEY_GREETER) == 0) {
-
- GtkWidget *local_plain_vbox;
- GtkWidget *local_themed_vbox;
- gint selected;
-
- local_plain_vbox = glade_helper_get (xml, "local_plain_properties_vbox",
- GTK_TYPE_VBOX);
- local_themed_vbox = glade_helper_get (xml, "local_themed_properties_vbox",
- GTK_TYPE_VBOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
-
- if (selected == LOCAL_PLAIN_WITH_FACE) {
- gtk_widget_show (local_plain_vbox);
- gtk_widget_hide (local_themed_vbox);
- }
- else if (selected == LOCAL_THEMED) {
- gtk_widget_hide (local_plain_vbox);
- gtk_widget_show (local_themed_vbox);
- }
- else { /* Plain style */
- gtk_widget_show (local_plain_vbox);
- gtk_widget_hide (local_themed_vbox);
- }
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_REMOTE_GREETER) == 0) {
-
- GtkWidget *remote_plain_vbox;
- GtkWidget *remote_themed_vbox;
- GtkWidget *configure_xdmcp_vbox;
- GtkWidget *welcome_message_vbox;
- gint selected;
-
- remote_plain_vbox = glade_helper_get (xml, "remote_plain_properties_vbox",
- GTK_TYPE_VBOX);
- remote_themed_vbox = glade_helper_get (xml, "remote_themed_properties_vbox",
- GTK_TYPE_VBOX);
- configure_xdmcp_vbox = glade_helper_get (xml, "remote_configure_xdmcp_vbox",
- GTK_TYPE_VBOX);
- welcome_message_vbox = glade_helper_get (xml, "remote_welcome_message_vbox",
- GTK_TYPE_VBOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
-
- if (selected == REMOTE_DISABLED) {
- GtkWidget *allowremoteauto;
- GtkWidget *allowremoteroot;
-
- allowremoteauto = glade_helper_get (xml, "allowremoteauto",
- GTK_TYPE_CHECK_BUTTON);
- allowremoteroot = glade_helper_get (xml, "allowremoteroot",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (allowremoteauto, FALSE);
- gtk_widget_set_sensitive (allowremoteroot, FALSE);
-
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_hide (welcome_message_vbox);
- gtk_widget_hide (configure_xdmcp_vbox);
- }
- else {
- GtkWidget *timedlogin;
- GtkWidget *allowremoteauto;
- GtkWidget *allowremoteroot;
-
- timedlogin = glade_helper_get (xml, "timedlogin",
- GTK_TYPE_CHECK_BUTTON);
- allowremoteauto = glade_helper_get (xml, "allowremoteauto",
- GTK_TYPE_CHECK_BUTTON);
- allowremoteroot = glade_helper_get (xml, "allowremoteroot",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (allowremoteauto, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (timedlogin)));
- gtk_widget_set_sensitive (allowremoteroot, TRUE);
-
- gtk_widget_show (welcome_message_vbox);
- gtk_widget_show (configure_xdmcp_vbox);
-
- if (selected == REMOTE_SAME_AS_LOCAL) {
- gchar *greeter_style;
-
- greeter_style = gdm_config_get_string (GDM_KEY_GREETER);
- update_remote_sensitivity (FALSE);
-
- if (strstr (greeter_style, "/gdmgreeter") != NULL) {
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_show (remote_themed_vbox);
- }
- else {
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_show (remote_plain_vbox);
- }
- }
- else if (selected == REMOTE_PLAIN_WITH_FACE) {
- update_remote_sensitivity (TRUE);
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_show (remote_plain_vbox);
- }
- else {
- gchar *selected_text;
-
- selected_text = gtk_combo_box_get_active_text (GTK_COMBO_BOX (combobox));
- update_remote_sensitivity (TRUE);
-
- if (strcmp (ve_sure_string (selected_text), _("Themed")) == 0) {
- gtk_widget_hide (remote_plain_vbox);
- gtk_widget_show (remote_themed_vbox);
- }
- else {
- gtk_widget_hide (remote_themed_vbox);
- gtk_widget_show (remote_plain_vbox);
- }
- g_free (selected_text);
- }
- }
-
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_GRAPHICAL_THEME_RAND) == 0) {
-
- GtkWidget *theme_list;
- GtkWidget *theme_list_remote;
- GtkWidget *delete_button;
- GtkWidget *delete_button_remote;
- GtkTreeViewColumn *radioColumn = NULL;
- GtkTreeViewColumn *radioColumnRemote = NULL;
- GtkTreeViewColumn *checkboxColumn = NULL;
- GtkTreeViewColumn *checkboxColumnRemote = NULL;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- gint selected;
-
- theme_list = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- theme_list_remote = glade_helper_get (xml, "gg_theme_list_remote",
- GTK_TYPE_TREE_VIEW);
- delete_button = glade_helper_get (xml, "gg_delete_theme",
- GTK_TYPE_BUTTON);
- delete_button_remote = glade_helper_get (xml, "gg_delete_theme_remote",
- GTK_TYPE_BUTTON);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
- GtkWidget *mode_combobox;
-
- mode_combobox = glade_helper_get (xml, "gg_mode_combobox_remote",
- GTK_TYPE_COMBO_BOX);
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode_combobox), selected);
-
- if (mode_combobox != combobox) {
- /* Display a warning when no themes are selected and the
- Random from selected option has been activated.
- This is a bit of a HACK as combo_box handler is
- called multiple times and we want this warning
- to be displayed only once */
-
- if (selected == RANDOM_THEME && ve_string_empty (selected_themes)) {
- GtkWidget *setup_dialog = glade_helper_get(xml,
- "setup_dialog", GTK_TYPE_WINDOW);
-
- GtkWidget *warn_dlg = ve_hig_dialog_new (GTK_WINDOW (setup_dialog) /* parent */,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("No themes selected!"),
- _("You need one or more themes selected for the "
- "\"Random from selected\" option to be valid. "
- "Failure to do so will force \"Selected only\" mode."));
- gtk_dialog_run (GTK_DIALOG (warn_dlg));
- gtk_widget_destroy (warn_dlg);
-
- GdmRandomFromSelectedChangesWarn = TRUE;
- }
- else if (selected == ONE_THEME)
- GdmRandomFromSelectedChangesWarn = FALSE;
- }
- }
- else {
- GtkWidget *mode_combobox;
-
- mode_combobox = glade_helper_get (xml, "gg_mode_combobox",
- GTK_TYPE_COMBO_BOX);
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode_combobox), selected);
-
- if (mode_combobox != combobox) {
- /* Display a warning when no themes are selected and the
- Random from selected option has been activated.
- This is a bit of a HACK as combo_box handler is
- called multiple times and we want this warning
- to be displayed only once */
- if (selected == RANDOM_THEME && ve_string_empty (selected_themes)) {
- GtkWidget *setup_dialog = glade_helper_get(xml,
- "setup_dialog", GTK_TYPE_WINDOW);
-
- GtkWidget *warn_dlg = ve_hig_dialog_new (GTK_WINDOW (setup_dialog) /* parent */,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("No themes selected!"),
- _("You need one or more themes "
- "selected for the \"Random from selected\" "
- "option to be valid. Failure to do so will "
- "force \"Selected only\" mode."));
- gtk_dialog_run (GTK_DIALOG (warn_dlg));
- gtk_widget_destroy (warn_dlg);
-
- GdmRandomFromSelectedChangesWarn = TRUE;
- }
- else if (selected == ONE_THEME) {
- GdmRandomFromSelectedChangesWarn = FALSE;
- }
- }
- }
-
- radioColumn = gtk_tree_view_get_column (GTK_TREE_VIEW (theme_list),
- THEME_COLUMN_SELECTED);
- radioColumnRemote = gtk_tree_view_get_column (GTK_TREE_VIEW (theme_list_remote),
- THEME_COLUMN_SELECTED);
- checkboxColumn = gtk_tree_view_get_column (GTK_TREE_VIEW (theme_list),
- THEME_COLUMN_SELECTED_LIST);
- checkboxColumnRemote = gtk_tree_view_get_column (GTK_TREE_VIEW (theme_list_remote),
- THEME_COLUMN_SELECTED_LIST);
-
- /* Choose to display radio or checkbox toggle column */
- if (selected == RANDOM_THEME) {
- if (GTK_IS_TREE_VIEW_COLUMN (radioColumn))
- gtk_tree_view_column_set_visible (radioColumn, FALSE);
- if (GTK_IS_TREE_VIEW_COLUMN (radioColumnRemote))
- gtk_tree_view_column_set_visible (radioColumnRemote, FALSE);
- if (GTK_IS_TREE_VIEW_COLUMN (checkboxColumn))
- gtk_tree_view_column_set_visible (checkboxColumn, TRUE);
- if (GTK_IS_TREE_VIEW_COLUMN (checkboxColumnRemote))
- gtk_tree_view_column_set_visible (checkboxColumnRemote, TRUE);
- } else { /* Default to one theme */
- if (GTK_IS_TREE_VIEW_COLUMN (radioColumn))
- gtk_tree_view_column_set_visible (radioColumn, TRUE);
- if (GTK_IS_TREE_VIEW_COLUMN (radioColumnRemote))
- gtk_tree_view_column_set_visible (radioColumnRemote, TRUE);
- if (GTK_IS_TREE_VIEW_COLUMN (checkboxColumn))
- gtk_tree_view_column_set_visible (checkboxColumn, FALSE);
- if (GTK_IS_TREE_VIEW_COLUMN (checkboxColumnRemote))
- gtk_tree_view_column_set_visible (checkboxColumnRemote, FALSE);
- }
-
- /* Update delete button's sensitivity */
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- if (!gtk_tree_selection_get_selected (selection, NULL, &iter)) {
- gtk_widget_set_sensitive (delete_button, FALSE);
- gtk_widget_set_sensitive (delete_button_remote, FALSE);
- }
- else {
- GValue value = {0, };
- GtkTreeModel *model;
- gboolean GdmGraphicalThemeRand;
-
- /* Determine if the theme selected is currently active */
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list));
-
- GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
- if (GdmGraphicalThemeRand) {
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED_LIST, &value);
-
- /* Make sure that the theme is not selected in the
- single theme mode */
- if (!g_value_get_boolean (&value)) {
- g_value_unset (&value);
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED, &value);
- }
- } else {
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED, &value);
-
- /* We might have "Random from selected" option selected, but no
- active themes there hence defaulting to "Selected only"
- Lets make this theme delete-able from "Random from selected"
- mode in this case */
- if (g_value_get_boolean (&value) && selected == RANDOM_THEME) {
- g_value_unset (&value);
- g_value_set_boolean (&value, FALSE);
- }
- }
-
- if (g_value_get_boolean (&value)) {
- /* Do not allow deleting of active themes */
- gtk_widget_set_sensitive (delete_button, FALSE);
- gtk_widget_set_sensitive (delete_button_remote, FALSE);
- }
- else {
- gtk_widget_set_sensitive (delete_button, TRUE);
- gtk_widget_set_sensitive (delete_button_remote, TRUE);
- }
-
- g_value_unset (&value);
- }
- }
- else if (strcmp (ve_sure_string (key), GDM_KEY_SERVER_PREFIX) == 0 ) {
- init_servers_combobox (gtk_combo_box_get_active (GTK_COMBO_BOX (combobox)));
- }
- else if (strcmp (ve_sure_string (key), _("command_chooser_combobox")) == 0) {
- gint selected;
- GtkWidget *hrs_cmd_vbox;
- GtkWidget *custom_cmd_vbox;
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox));
-
- /* First of all we need to check if we had made any changes
- to any of the command fields. If so user gets reminded and
- given an option to save, or discard */
- if (g_hash_table_size (GdmCommandChangesUnsaved) != 0) {
- GtkWidget *prompt;
- GtkWidget *setup_dialog;
- GtkWidget *apply_command;
- gint response;
-
- setup_dialog = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
-
- prompt = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Apply changes to the modified command?"),
- _("If you don't apply, the changes "
- "will be discarded."));
-
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-cancel", GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-apply", GTK_RESPONSE_APPLY);
-
- response = gtk_dialog_run (GTK_DIALOG (prompt));
- gtk_widget_destroy (prompt);
-
- apply_command = glade_helper_get (xml_commands, "command_apply_button",
- GTK_TYPE_BUTTON);
- if (response == GTK_RESPONSE_APPLY)
- g_signal_emit_by_name (G_OBJECT (apply_command), "clicked");
-
- else {
- g_hash_table_remove_all (GdmCommandChangesUnsaved);
- gtk_widget_set_sensitive (apply_command, FALSE);
- }
- }
-
- last_selected_command = selected;
-
- hrs_cmd_vbox = glade_helper_get (xml_commands, "hrs_command_vbox",
- GTK_TYPE_VBOX);
- custom_cmd_vbox = glade_helper_get (xml_commands, "custom_command_vbox",
- GTK_TYPE_VBOX);
- if (selected > SUSPEND_CMD) {
- /* We are dealing with custom commands */
- gtk_widget_show (custom_cmd_vbox);
- gtk_widget_hide (hrs_cmd_vbox);
- }
- else {
- /* We are dealing with hrs (Halt, Reboot, Shutdown) commands */
- gtk_widget_hide (custom_cmd_vbox);
- gtk_widget_show (hrs_cmd_vbox);
- }
-
- /* We dont want default timeout for this one so we
- are going to bail out now */
- run_timeout (combobox, 10, combobox_timeout);
- return;
- }
- run_timeout (combobox, 500, combobox_timeout);
-}
-
-static void
-timeout_remove (GtkWidget *widget)
-{
- gboolean (*func) (GtkWidget *);
- guint id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
- "change_timeout"));
- if (id != 0) {
- g_source_remove (id);
- g_object_set_data (G_OBJECT (widget), "change_timeout", NULL);
- }
-
- func = g_object_get_data (G_OBJECT (widget), "timeout_func");
- if (func != NULL) {
- (*func) (widget);
- g_object_set_data (G_OBJECT (widget), "timeout_func", NULL);
- }
-}
-
-static void
-timeout_remove_all (void)
-{
- GList *li, *list;
-
- list = timeout_widgets;
- timeout_widgets = NULL;
-
- for (li = list; li != NULL; li = li->next) {
- timeout_remove (li->data);
- li->data = NULL;
- }
- g_list_free (list);
-}
-
-static void
-toggle_toggled_sensitivity_positive (GtkWidget *toggle, GtkWidget *depend)
-{
- gtk_widget_set_sensitive (depend, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)));
-}
-
-static void
-toggle_toggled_sensitivity_negative (GtkWidget *toggle, GtkWidget *depend)
-{
- gtk_widget_set_sensitive (depend, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)));
-}
-
-static void
-timedlogin_allow_remote_toggled (GtkWidget *toggle, GtkWidget *depend)
-{
- if (gdm_config_get_bool (GDM_KEY_XDMCP) == TRUE) {
- gtk_widget_set_sensitive (depend, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)));
- }
- else {
- gtk_widget_set_sensitive (depend, FALSE);
- }
-}
-
-static void
-setup_notify_toggle (const char *name,
- const char *key)
-{
- GtkWidget *toggle;
- gboolean val;
-
- toggle = glade_helper_get (xml, name, GTK_TYPE_TOGGLE_BUTTON);
- val = gdm_config_get_bool ((gchar *)key);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), val);
-
- g_object_set_data_full (G_OBJECT (toggle),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- if (strcmp (ve_sure_string (name), "sysmenu") == 0) {
-
- GtkWidget *config_available;
- GtkWidget *chooser_button;
-
- config_available = glade_helper_get (xml, "config_available",
- GTK_TYPE_CHECK_BUTTON);
- chooser_button = glade_helper_get (xml, "chooser_button",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (config_available, val);
- gtk_widget_set_sensitive (chooser_button, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), config_available);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), chooser_button);
- }
- else if (strcmp ("autologin", ve_sure_string (name)) == 0) {
-
- GtkWidget *autologin_label;
- GtkWidget *autologin_combo;
-
- autologin_label = glade_helper_get (xml, "autologin_label",
- GTK_TYPE_LABEL);
- autologin_combo = glade_helper_get (xml, "autologin_combo",
- GTK_TYPE_COMBO_BOX);
-
- gtk_widget_set_sensitive (autologin_label, val);
- gtk_widget_set_sensitive (autologin_combo, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive),
- autologin_label);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive),
- autologin_combo);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- }
- else if (strcmp ("timedlogin", ve_sure_string (name)) == 0) {
-
- GtkWidget *timedlogin_label;
- GtkWidget *timedlogin_combo;
- GtkWidget *timedlogin_seconds_label;
- GtkWidget *timedlogin_seconds_spin_button;
- GtkWidget *timedlogin_seconds_units;
- GtkWidget *timedlogin_allow_remote;
-
- timedlogin_label = glade_helper_get (xml, "timed_login_label",
- GTK_TYPE_LABEL);
- timedlogin_combo = glade_helper_get (xml, "timedlogin_combo",
- GTK_TYPE_COMBO_BOX);
- timedlogin_seconds_label = glade_helper_get (xml, "timedlogin_seconds_label",
- GTK_TYPE_LABEL);
- timedlogin_seconds_spin_button = glade_helper_get (xml,"timedlogin_seconds",
- GTK_TYPE_SPIN_BUTTON);
- timedlogin_seconds_units = glade_helper_get (xml,"timedlogin_seconds_units",
- GTK_TYPE_LABEL);
- timedlogin_allow_remote = glade_helper_get (xml, "allowremoteauto",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (timedlogin_label, val);
- gtk_widget_set_sensitive (timedlogin_combo, val);
- gtk_widget_set_sensitive (timedlogin_seconds_label, val);
- gtk_widget_set_sensitive (timedlogin_seconds_spin_button, val);
- gtk_widget_set_sensitive (timedlogin_seconds_units, val);
-
- if (gdm_config_get_bool (GDM_KEY_XDMCP) == FALSE) {
- gtk_widget_set_sensitive (timedlogin_allow_remote, FALSE);
- }
- else {
- gtk_widget_set_sensitive (timedlogin_allow_remote, val);
- }
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), timedlogin_label);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), timedlogin_combo);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), timedlogin_seconds_label);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), timedlogin_seconds_spin_button);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), timedlogin_seconds_units);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (timedlogin_allow_remote_toggled), timedlogin_allow_remote);
- }
- else if (strcmp ("vis_feedback_passwd_checkbox", ve_sure_string (name)) == 0) {
- /* This one is a lil bit back to front
- true is false and false is true */
- GtkWidget *use_circles_in_passwd;
- use_circles_in_passwd = glade_helper_get (xml, "use_circles_passwd_checkbox",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), !val);
- gtk_widget_set_sensitive (use_circles_in_passwd, !val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), use_circles_in_passwd);
-
- }
- else if (strcmp ("local_set_pos_checkbox", ve_sure_string (name)) == 0) {
-
- GtkWidget *posx;
- GtkWidget *posy;
-
- posx = glade_helper_get (xml, "local_posx_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
-
- posy = glade_helper_get (xml, "local_posy_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
-
- gtk_widget_set_sensitive (posx, val);
- gtk_widget_set_sensitive (posy, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), posx);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), posy);
- }
- else if (strcmp ("remote_set_pos_checkbox", ve_sure_string (name)) == 0) {
-
- GtkWidget *posx;
- GtkWidget *posy;
-
- posx = glade_helper_get (xml, "remote_posx_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
-
- posy = glade_helper_get (xml, "remote_posy_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
-
- gtk_widget_set_sensitive (posx, val);
- gtk_widget_set_sensitive (posy, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), posx);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), posy);
- }
- else if (strcmp ("local_title_bar_checkbutton", ve_sure_string (name)) == 0) {
- GtkWidget *lockpos;
-
- lockpos = glade_helper_get (xml, "local_lock_pos_checkbox",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (lockpos, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), lockpos);
- }
- else if (strcmp ("remote_title_bar_checkbutton", ve_sure_string (name)) == 0) {
- GtkWidget *lockpos;
-
- lockpos = glade_helper_get (xml, "remote_lock_pos_checkbox",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (lockpos, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), lockpos);
- }
- else if (strcmp ("disallow_tcp", ve_sure_string (name)) == 0) {
- GtkWidget *nfs_cookies;
-
- nfs_cookies = glade_helper_get (xml, "never_cookies_NFS_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_widget_set_sensitive (nfs_cookies, !val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), toggle);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_negative), nfs_cookies);
-
- }
- else {
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), NULL);
- }
-}
-
-static gboolean
-commands_entry_timeout (GtkWidget *entry)
-{
- GtkWidget *apply_cmd_changes;
- GtkWidget *command_combobox;
- gint selected;
-
- const char *key = g_object_get_data (G_OBJECT (entry), "key");
- const gchar *val = gtk_entry_get_text (GTK_ENTRY (entry));
-
- apply_cmd_changes = glade_helper_get (xml_commands, "command_apply_button", GTK_TYPE_BUTTON);
- command_combobox = glade_helper_get (xml_commands, "cmd_type_combobox", GTK_TYPE_COMBO_BOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (command_combobox));
-
- /* All hrs (Halt, Shutdown, Suspend) commands will fall into this category */
- if (strcmp ("hrs_custom_cmd", ve_sure_string (key)) == 0) {
- gchar *old_val = NULL;
- gchar *cmd_key = NULL;
-
- if (selected == HALT_CMD)
- cmd_key = g_strdup (GDM_KEY_HALT);
- else if (selected == REBOOT_CMD)
- cmd_key = g_strdup (GDM_KEY_REBOOT);
- else if (selected == SUSPEND_CMD)
- cmd_key = g_strdup (GDM_KEY_SUSPEND);
-
- old_val = gdm_config_get_string (cmd_key);
-
- if (strcmp (ve_sure_string (val), ve_sure_string (old_val)) != 0)
- g_hash_table_insert (GdmCommandChangesUnsaved, g_strdup (cmd_key), g_strdup (val));
-
- else if (g_hash_table_lookup (GdmCommandChangesUnsaved, cmd_key) != NULL)
- g_hash_table_remove (GdmCommandChangesUnsaved, cmd_key);
-
- g_free (old_val);
- g_free (cmd_key);
- }
- /* All the custom commands will fall into this category */
- else {
- gchar *key_string = NULL;
- gchar *old_val = NULL;
- gint i;
-
- i = selected - CUSTOM_CMD;
- key_string = g_strdup_printf(_("%s%d="), ve_sure_string (key), i);
- old_val = gdm_config_get_string (key_string);
-
-
- if (strcmp (ve_sure_string (val), ve_sure_string (old_val)) != 0)
- g_hash_table_insert (GdmCommandChangesUnsaved, g_strdup (key_string), g_strdup (val));
-
- else if (g_hash_table_lookup (GdmCommandChangesUnsaved, key_string) != NULL)
- g_hash_table_remove (GdmCommandChangesUnsaved, key_string);
-
- g_free (old_val);
- g_free (key_string);
- }
-
- if (g_hash_table_size (GdmCommandChangesUnsaved) == 0)
- gtk_widget_set_sensitive (apply_cmd_changes, FALSE);
- else
- gtk_widget_set_sensitive (apply_cmd_changes, TRUE);
-
- return FALSE;
-}
-
-static void
-commands_entry_changed (GtkWidget *entry)
-{
- run_timeout (entry, 100, commands_entry_timeout);
-}
-
-static void
-setup_commands_text_entry (const char *name,
- const char *key)
-{
- GtkWidget *entry;
-
- entry = glade_helper_get (xml_commands, name, GTK_TYPE_ENTRY);
-
- g_object_set_data_full (G_OBJECT (entry),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (entry), "changed",
- G_CALLBACK (commands_entry_changed), NULL);
-}
-
-static void
-setup_commands_notify_toggle (const char *name,
- const char *key)
-{
- GtkWidget *toggle;
-
- toggle = glade_helper_get (xml_commands, name, GTK_TYPE_TOGGLE_BUTTON);
-
- g_object_set_data_full (G_OBJECT (toggle),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (command_toggle_toggled), NULL);
-}
-
-#ifdef HAVE_LIBXDMCP
-static void
-setup_xdmcp_notify_toggle (const char *name,
- const char *key)
-{
- GtkWidget *toggle;
- gboolean val;
-
- toggle = glade_helper_get (xml_xdmcp, name, GTK_TYPE_TOGGLE_BUTTON);
-
- val = gdm_config_get_bool ((gchar *)key);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), val);
-
- g_object_set_data_full (G_OBJECT (toggle),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (toggle_toggled), NULL);
-}
-#endif
-
-static void
-root_not_allowed (GtkWidget *combo_box)
-{
- static gboolean warned = FALSE;
- const char *text = NULL;
- GtkTreeIter iter;
-
- if (warned)
- return;
-
- if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (combo_box),
- &iter)) {
- gtk_tree_model_get (gtk_combo_box_get_model (
- GTK_COMBO_BOX (combo_box)), &iter,
- 0, &text, -1);
- }
-
- if ( ! ve_string_empty (text) &&
- strcmp (text, get_root_user ()) == 0) {
- GtkWidget *dlg =
- ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Autologin or timed login to the root account is not allowed."),
- "");
- if (RUNNING_UNDER_GDM)
- setup_cursor (GDK_LEFT_PTR);
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- warned = TRUE;
- }
-}
-
-static gint
-users_string_compare_func (gconstpointer a, gconstpointer b)
-{
- return strcmp(a, b);
-}
-
-/* Sets up Automatic Login Username and Timed Login User entry comboboxes
- * from the general configuration tab. */
-static void
-setup_user_combobox_list (const char *name, const char *key)
-{
- GtkListStore *combobox_store = NULL;
- GtkWidget *combobox_entry = glade_helper_get (xml, name,
- GTK_TYPE_COMBO_BOX_ENTRY);
- GtkTreeIter iter;
- GList *users = NULL;
- GList *users_string = NULL;
- GList *li;
- static gboolean GDM_IS_LOCAL = FALSE;
- char *selected_user;
- gint size_of_users = 0;
- int selected = -1;
- int cnt;
-
- combobox_store = gtk_list_store_new (USERLIST_NUM_COLUMNS, G_TYPE_STRING);
- selected_user = gdm_config_get_string ((gchar *)key);
-
- /* normally empty */
- users_string = g_list_append (users_string, g_strdup (""));
-
- if ( ! ve_string_empty (selected_user))
- users_string = g_list_append (users_string, g_strdup (selected_user));
-
- if (ve_string_empty (g_getenv ("GDM_IS_LOCAL")))
- GDM_IS_LOCAL = FALSE;
- else
- GDM_IS_LOCAL = TRUE;
-
- gdm_users_init (&users, &users_string, selected_user, NULL,
- &size_of_users, GDM_IS_LOCAL, FALSE);
-
- users_string = g_list_sort (users_string, users_string_compare_func);
-
- cnt=0;
- for (li = users_string; li != NULL; li = li->next) {
- if (strcmp (li->data, ve_sure_string (selected_user)) == 0)
- selected=cnt;
- gtk_list_store_append (combobox_store, &iter);
- gtk_list_store_set(combobox_store, &iter, USERLIST_NAME, li->data, -1);
- cnt++;
- }
-
- gtk_combo_box_set_model (GTK_COMBO_BOX (combobox_entry),
- GTK_TREE_MODEL (combobox_store));
-
- if (selected != -1)
- gtk_combo_box_set_active (GTK_COMBO_BOX (combobox_entry), selected);
-
- g_list_foreach (users, (GFunc)g_free, NULL);
- g_list_free (users);
- g_list_foreach (users_string, (GFunc)g_free, NULL);
- g_list_free (users_string);
-}
-
-static void
-setup_user_combobox (const char *name, const char *key)
-{
- GtkWidget *combobox_entry = glade_helper_get (xml, name, GTK_TYPE_COMBO_BOX_ENTRY);
- setup_user_combobox_list (name, key);
- g_object_set_data_full (G_OBJECT (combobox_entry), "key",
- g_strdup (key), (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (combobox_entry), "changed",
- G_CALLBACK (combobox_changed), NULL);
- g_signal_connect (G_OBJECT (combobox_entry), "changed",
- G_CALLBACK (root_not_allowed), NULL);
-}
-
-static void
-setup_intspin (const char *name,
- const char *key)
-{
- GtkWidget *spin = glade_helper_get (xml, name,
- GTK_TYPE_SPIN_BUTTON);
- int val = gdm_config_get_int ((gchar *)key);
-
- g_object_set_data_full (G_OBJECT (spin),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), val);
-
- g_signal_connect (G_OBJECT (spin), "value_changed",
- G_CALLBACK (intspin_changed), NULL);
-}
-
-#ifdef HAVE_LIBXDMCP
-static void
-setup_xdmcp_intspin (const char *name,
- const char *key)
-{
- GtkWidget *spin;
- int val = gdm_config_get_int ((gchar *)key);
-
- spin = glade_helper_get (xml_xdmcp,
- name,
- GTK_TYPE_SPIN_BUTTON);
-
-
- g_object_set_data_full (G_OBJECT (spin),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), val);
-
- g_signal_connect (G_OBJECT (spin), "value_changed",
- G_CALLBACK (intspin_changed), NULL);
-}
-#endif
-
-static GtkListStore *
-setup_include_exclude (GtkWidget *treeview, const char *key)
-{
- GtkListStore *face_store = gtk_list_store_new (USERLIST_NUM_COLUMNS,
- G_TYPE_STRING);
- GtkTreeIter iter;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- char **list;
- int i;
-
- column = gtk_tree_view_column_new ();
-
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
-
- gtk_tree_view_column_set_attributes (column, renderer,
- "text", USERLIST_NAME, NULL);
-
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
- gtk_tree_view_set_model (GTK_TREE_VIEW(treeview),
- (GTK_TREE_MODEL (face_store)));
-
- if ((! ve_string_empty (GdmInclude)) &&
- (strcmp (ve_sure_string (key), GDM_KEY_INCLUDE) == 0))
- list = g_strsplit (GdmInclude, ",", 0);
- else if ((! ve_string_empty (GdmExclude)) &&
- (strcmp (ve_sure_string (key), GDM_KEY_EXCLUDE) == 0))
- list = g_strsplit (GdmExclude, ",", 0);
- else
- list = NULL;
-
- for (i=0; list != NULL && list[i] != NULL; i++) {
- gtk_list_store_append (face_store, &iter);
- gtk_list_store_set(face_store, &iter, USERLIST_NAME, list[i], -1);
- }
- g_strfreev (list);
-
- return (face_store);
-}
-
-typedef enum {
- INCLUDE,
- EXCLUDE
-} FaceType;
-
-typedef struct _FaceCommon {
- GtkWidget *apply;
- GtkWidget *include_treeview;
- GtkWidget *exclude_treeview;
- GtkListStore *include_store;
- GtkListStore *exclude_store;
- GtkTreeModel *include_model;
- GtkTreeModel *exclude_model;
- GtkWidget *include_add;
- GtkWidget *exclude_add;
- GtkWidget *include_del;
- GtkWidget *exclude_del;
- GtkWidget *to_include_button;
- GtkWidget *to_exclude_button;
- GtkWidget *allusers;
-} FaceCommon;
-
-typedef struct _FaceData {
- FaceCommon *fc;
- FaceType type;
-} FaceData;
-
-typedef struct _FaceApply {
- FaceData *exclude;
- FaceData *include;
-} FaceApply;
-
-static void
-face_add (FaceData *fd)
-{
- GtkWidget *user_entry;
- const char *text = NULL;
- const char *model_text;
- GtkTreeIter iter;
- gboolean valid;
-
- user_entry = glade_helper_get (xml_add_users, "fb_addentry",
- GTK_TYPE_ENTRY);
- text = gtk_entry_get_text (GTK_ENTRY (user_entry));
-
- if (gdm_is_user_valid (text)) {
- valid = gtk_tree_model_get_iter_first (fd->fc->include_model, &iter);
- while (valid) {
- gtk_tree_model_get (fd->fc->include_model, &iter, USERLIST_NAME,
- &model_text, -1);
- if (strcmp (ve_sure_string (text), ve_sure_string (model_text)) == 0) {
- GtkWidget *setup_dialog;
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("The \"%s\" user already exists in the include list."), text);
-
- setup_dialog = glade_helper_get (xml_add_users, "add_user_dialog",
- GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot add user"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- return;
- }
-
- valid = gtk_tree_model_iter_next (fd->fc->include_model, &iter);
- }
-
- valid = gtk_tree_model_get_iter_first (fd->fc->exclude_model, &iter);
- while (valid) {
- gtk_tree_model_get (fd->fc->exclude_model, &iter, USERLIST_NAME,
- &model_text, -1);
- if (strcmp (ve_sure_string (text), ve_sure_string (model_text)) == 0) {
- GtkWidget *setup_dialog;
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("The \"%s\" user already exists in the exclude list."), text);
-
- setup_dialog = glade_helper_get (xml_add_users, "add_user_dialog",
- GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot add user"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- return;
- }
-
- valid = gtk_tree_model_iter_next (fd->fc->exclude_model, &iter);
- }
-
- if (fd->type == INCLUDE) {
- /* Now the user is valid but his/hers UID might be smaller than the MinimalUID */
- gint user_uid = gdm_user_uid (text);
- if (user_uid < gdm_config_get_int (GDM_KEY_MINIMAL_UID)) {
- GtkWidget *setup_dialog;
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("The \"%s\" user UID is lower than allowed MinimalUID."), text);
-
- setup_dialog = glade_helper_get (xml_add_users, "add_user_dialog",
- GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot add user"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- return;
- }
- gtk_list_store_append (fd->fc->include_store, &iter);
- gtk_list_store_set (fd->fc->include_store, &iter,
- USERLIST_NAME, text, -1);
- } else if (fd->type == EXCLUDE) {
- gtk_list_store_append (fd->fc->exclude_store, &iter);
- gtk_list_store_set (fd->fc->exclude_store, &iter,
- USERLIST_NAME, text, -1);
- }
- gtk_widget_set_sensitive (fd->fc->apply, TRUE);
- GdmUserChangesUnsaved = TRUE;
- } else {
- GtkWidget *setup_dialog;
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("The \"%s\" user does not exist."), text);
-
- setup_dialog = glade_helper_get (xml_add_users, "add_user_dialog",
- GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot add user"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- }
-}
-
-static void
-face_del (GtkWidget *button, gpointer data)
-{
- FaceData *fd = data;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
-
- if (fd->type == INCLUDE) {
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fd->fc->include_treeview));
-
- if (gtk_tree_selection_get_selected (selection, &(fd->fc->include_model), &iter)) {
- gtk_list_store_remove (fd->fc->include_store, &iter);
- gtk_widget_set_sensitive (fd->fc->apply, TRUE);
- GdmUserChangesUnsaved = TRUE;
- }
- } else if (fd->type == EXCLUDE) {
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fd->fc->exclude_treeview));
-
- if (gtk_tree_selection_get_selected (selection, &(fd->fc->exclude_model), &iter)) {
- gtk_list_store_remove (fd->fc->exclude_store, &iter);
- gtk_widget_set_sensitive (fd->fc->apply, TRUE);
- GdmUserChangesUnsaved = TRUE;
- }
- }
-}
-
-static void
-browser_move (GtkWidget *button, gpointer data)
-{
- FaceData *fd = data;
- GtkTreeSelection *selection = NULL;
- GtkTreeIter iter;
- GtkTreeModel *model = NULL;
- char *text;
-
- /* The fd->type value passed in corresponds with the list moving to */
- if (fd->type == INCLUDE) {
- model = fd->fc->exclude_model;
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fd->fc->exclude_treeview));
- } else if (fd->type == EXCLUDE) {
- model = fd->fc->include_model;
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fd->fc->include_treeview));
- }
-
- if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_tree_model_get (model, &iter, USERLIST_NAME, &text, -1);
- if (fd->type == INCLUDE) {
- /* We cant move the users that have uid smaller that MinimalUID */
- gint user_uid = gdm_user_uid (text);
- if (user_uid < gdm_config_get_int (GDM_KEY_MINIMAL_UID)) {
- GtkWidget *setup_dialog;
- GtkWidget *dialog;
- gchar *str;
-
- str = g_strdup_printf (_("The \"%s\" user UID is lower than allowed MinimalUID."), text);
-
- setup_dialog = glade_helper_get (xml_add_users, "add_user_dialog",
- GTK_TYPE_WINDOW);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot add user"),
- str);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- return;
- }
- gtk_list_store_remove (fd->fc->exclude_store, &iter);
- gtk_list_store_append (fd->fc->include_store, &iter);
- gtk_list_store_set (fd->fc->include_store, &iter,
- USERLIST_NAME, text, -1);
- } else if (fd->type == EXCLUDE) {
- gtk_list_store_remove (fd->fc->include_store, &iter);
- gtk_list_store_append (fd->fc->exclude_store, &iter);
- gtk_list_store_set (fd->fc->exclude_store, &iter,
- USERLIST_NAME, text, -1);
- }
- gtk_widget_set_sensitive (fd->fc->apply, TRUE);
- GdmUserChangesUnsaved = TRUE;
- }
-}
-
-/* Hash key happens to be equal to the config entry key,
- se we save the value under the key and clean up
-*/
-static gboolean
-unsaved_data_from_hash_table_func (gpointer key, gpointer value, gpointer user_data)
-{
- gchar *c_key = key;
- if (strncmp (c_key, GDM_KEY_CUSTOM_CMD_NO_RESTART_TEMPLATE,
- strlen (GDM_KEY_CUSTOM_CMD_NO_RESTART_TEMPLATE)) == 0 ||
- strncmp (c_key, GDM_KEY_CUSTOM_CMD_IS_PERSISTENT_TEMPLATE,
- strlen (GDM_KEY_CUSTOM_CMD_IS_PERSISTENT_TEMPLATE)) == 0) {
- gboolean *p_val = (gboolean*)value;
- gdm_setup_config_set_bool (c_key, *p_val);
- }
- else
- gdm_setup_config_set_string (c_key, (gchar*)value);
-
- /* And final cleanup */
- g_free (value);
- g_free (key);
-
- return TRUE;
-}
-
-/* Go thru and remove each of the hash entries
- then clean the hash (if not already empty)
- just in case, then de-sensitise the apply
- command changes button
-*/
-static void
-command_apply (GtkWidget *button, gpointer data)
-{
- const gchar *command = NULL;
- GtkWidget *cmd_path_entry = NULL;
- GtkWidget *command_combobox = (GtkWidget*)data;
- gboolean command_exists = FALSE;
- gint selected;
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (command_combobox));
-
- if (last_selected_command < CUSTOM_CMD)
- cmd_path_entry = glade_helper_get (xml_commands,
- "hrs_cmd_path_entry",
- GTK_TYPE_ENTRY);
- else
- cmd_path_entry = glade_helper_get (xml_commands,
- "custom_cmd_path_entry",
- GTK_TYPE_ENTRY);
-
- command = gtk_entry_get_text (GTK_ENTRY (cmd_path_entry));
-
- command_exists = ve_string_empty (command) || gdm_working_command_exists (command);
-
- if(command_exists)
- g_hash_table_foreach_remove (GdmCommandChangesUnsaved,
- (GHRFunc) unsaved_data_from_hash_table_func, NULL);
-
- else {
- GtkWidget *parent = glade_helper_get (xml_commands, "commands_dialog", GTK_TYPE_WINDOW);
-
- GtkWidget *dialog = ve_hig_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Invalid command path"),
- _("The path you provided for this "
- "command is not valid. The changes "
- "will not be saved."));
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-
- /* Just to make sure */
- if (g_hash_table_size (GdmCommandChangesUnsaved) != 0)
- g_hash_table_remove_all (GdmCommandChangesUnsaved);
-
- gtk_widget_set_sensitive (button, FALSE);
-
- if (selected == last_selected_command)
- g_signal_emit_by_name (G_OBJECT (command_combobox), "changed");
-
- if(command_exists)
- update_greeters ();
-}
-
-static void
-browser_apply (GtkWidget *button, gpointer data)
-{
- FaceCommon *fc = data;
- GString *userlist = g_string_new (NULL);
- const char *model_text;
- char *val;
- GtkTreeIter iter;
- gboolean valid;
- gboolean update_greet = FALSE;
- char *sep = "";
- gint minimalUID = -1;
- gboolean any_removed = FALSE;
-
- minimalUID = gdm_config_get_int (GDM_KEY_MINIMAL_UID);
-
- valid = gtk_tree_model_get_iter_first (fc->include_model, &iter);
- while (valid) {
- gtk_tree_model_get (fc->include_model, &iter, USERLIST_NAME,
- &model_text, -1);
-
- /* We need to take check that during the time between adding
- a user and clicking on the apply button UID has not changed
- If so then the offending users should be removed
- */
- if (gdm_user_uid (model_text) < minimalUID) {
- valid = gtk_list_store_remove (fc->include_store, &iter);
- any_removed = TRUE;
- }
- else {
- g_string_append (userlist, sep);
- sep = ",";
- g_string_append (userlist, model_text);
- valid = gtk_tree_model_iter_next (fc->include_model, &iter);
- }
- }
-
- if (any_removed) {
- GtkWidget *setup_dialog;
- GtkWidget *dlg;
-
- setup_dialog = glade_helper_get(xml, "setup_dialog", GTK_TYPE_WINDOW);
-
- //Inform user about the change
- dlg = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Users include list modification"),
- _("Some of the users had uid lower than "
- "MinimalUID (Security tab) and "
- "could not be added."));
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
-
- }
-
- val = gdm_config_get_string (GDM_KEY_INCLUDE);
-
- if (strcmp (ve_sure_string (val),
- ve_sure_string (userlist->str)) != 0) {
- gdm_setup_config_set_string (GDM_KEY_INCLUDE, userlist->str);
- update_greet = TRUE;
- }
-
- g_string_free (userlist, TRUE);
-
- userlist = g_string_new (NULL);
- sep = "";
- valid = gtk_tree_model_get_iter_first (fc->exclude_model, &iter);
- while (valid) {
- gtk_tree_model_get (fc->exclude_model, &iter, USERLIST_NAME,
- &model_text, -1);
-
- g_string_append (userlist, sep);
- sep = ",";
- g_string_append (userlist, model_text);
-
- valid = gtk_tree_model_iter_next (fc->exclude_model, &iter);
- }
-
- val = gdm_config_get_string (GDM_KEY_EXCLUDE);
-
- if (strcmp (ve_sure_string (val),
- ve_sure_string (userlist->str)) != 0) {
- gdm_setup_config_set_string (GDM_KEY_EXCLUDE, userlist->str);
- update_greet = TRUE;
- }
-
- if (update_greet)
- update_greeters ();
-
- /* Re-initialize combox with updated userlist. */
- GdmInclude = gdm_config_get_string (GDM_KEY_INCLUDE);
- GdmExclude = gdm_config_get_string (GDM_KEY_EXCLUDE);
- setup_user_combobox_list ("autologin_combo",
- GDM_KEY_AUTOMATIC_LOGIN);
- setup_user_combobox_list ("timedlogin_combo",
- GDM_KEY_TIMED_LOGIN);
- gtk_widget_set_sensitive (button, FALSE);
-
- GdmUserChangesUnsaved = FALSE;
- g_string_free (userlist, TRUE);
-}
-
-
-static void
-face_rowdel (GtkTreeModel *treemodel, GtkTreePath *arg1, gpointer data)
-{
- FaceCommon *fc = data;
- GtkTreeIter iter;
- GtkTreeSelection *selection;
-
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fc->include_treeview));
- if (gtk_tree_selection_get_selected (selection, &(fc->include_model), &iter)) {
- gtk_widget_set_sensitive (fc->to_exclude_button, TRUE);
- gtk_widget_set_sensitive (fc->include_del, TRUE);
- } else {
- gtk_widget_set_sensitive (fc->to_exclude_button, FALSE);
- gtk_widget_set_sensitive (fc->include_del, FALSE);
- }
-
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fc->exclude_treeview));
- if (gtk_tree_selection_get_selected (selection, &(fc->exclude_model), &iter)) {
- gtk_widget_set_sensitive (fc->to_include_button, TRUE);
- gtk_widget_set_sensitive (fc->exclude_del, TRUE);
- } else {
- gtk_widget_set_sensitive (fc->to_include_button, FALSE);
- gtk_widget_set_sensitive (fc->exclude_del, FALSE);
- }
-}
-
-static void
-face_selection_changed (GtkTreeSelection *selection, gpointer data)
-{
- FaceData *fd = data;
- GtkTreeIter iter;
-
- if (fd->type == INCLUDE) {
- if (gtk_tree_selection_get_selected (selection, &(fd->fc->include_model), &iter)) {
- gtk_widget_set_sensitive (fd->fc->to_exclude_button, TRUE);
- gtk_widget_set_sensitive (fd->fc->include_del, TRUE);
- } else {
- gtk_widget_set_sensitive (fd->fc->to_exclude_button, FALSE);
- gtk_widget_set_sensitive (fd->fc->include_del, FALSE);
- }
- } else if (fd->type == EXCLUDE) {
- if (gtk_tree_selection_get_selected (selection, &(fd->fc->exclude_model), &iter)) {
- gtk_widget_set_sensitive (fd->fc->to_include_button, TRUE);
- gtk_widget_set_sensitive (fd->fc->exclude_del, TRUE);
- } else {
- gtk_widget_set_sensitive (fd->fc->to_include_button, FALSE);
- gtk_widget_set_sensitive (fd->fc->exclude_del, FALSE);
- }
- }
-}
-
-static void
-users_add_button_clicked (GtkWidget *button, gpointer data)
-{
- static GtkWidget *dialog = NULL;
- FaceData *fd = data;
- GtkWidget *user_entry;
- GtkWidget *parent;
-
- if (dialog == NULL) {
- parent = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- dialog = glade_helper_get (xml_add_users, "add_user_dialog", GTK_TYPE_DIALOG);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
- }
-
- user_entry = glade_helper_get (xml_add_users, "fb_addentry",
- GTK_TYPE_ENTRY);
-
- gtk_widget_grab_focus (user_entry);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- face_add (fd);
- }
- gtk_widget_hide (dialog);
-}
-
-static void
-setup_face (void)
-{
- static FaceCommon fc;
- static FaceData fd_include;
- static FaceData fd_exclude;
- static FaceApply face_apply;
-
- GtkTreeSelection *selection;
-
- fc.include_add = glade_helper_get (xml, "fb_includeadd",
- GTK_TYPE_WIDGET);
- fc.include_del = glade_helper_get (xml, "fb_includedelete",
- GTK_TYPE_WIDGET);
- fc.exclude_add = glade_helper_get (xml, "fb_excludeadd",
- GTK_TYPE_WIDGET);
- fc.exclude_del = glade_helper_get (xml, "fb_excludedelete",
- GTK_TYPE_WIDGET);
- fc.to_include_button = glade_helper_get (xml, "fb_toinclude",
- GTK_TYPE_WIDGET);
- fc.to_exclude_button = glade_helper_get (xml, "fb_toexclude",
- GTK_TYPE_WIDGET);
- fc.apply = glade_helper_get (xml, "fb_faceapply",
- GTK_TYPE_WIDGET);
- fc.include_treeview = glade_helper_get (xml, "fb_include_treeview",
- GTK_TYPE_TREE_VIEW);
- fc.exclude_treeview = glade_helper_get (xml, "fb_exclude_treeview",
- GTK_TYPE_TREE_VIEW);
- fc.allusers = glade_helper_get (xml, "fb_allusers",
- GTK_TYPE_TOGGLE_BUTTON);
-
- fc.include_store = setup_include_exclude (fc.include_treeview,
- GDM_KEY_INCLUDE);
- fc.exclude_store = setup_include_exclude (fc.exclude_treeview,
- GDM_KEY_EXCLUDE);
-
- fc.include_model = gtk_tree_view_get_model (
- GTK_TREE_VIEW (fc.include_treeview));
- fc.exclude_model = gtk_tree_view_get_model (
- GTK_TREE_VIEW (fc.exclude_treeview));
-
- fd_include.fc = &fc;
- fd_include.type = INCLUDE;
-
- fd_exclude.fc = &fc;
- fd_exclude.type = EXCLUDE;
-
- gtk_widget_set_sensitive (fc.include_del, FALSE);
- gtk_widget_set_sensitive (fc.exclude_del, FALSE);
- gtk_widget_set_sensitive (fc.to_include_button, FALSE);
- gtk_widget_set_sensitive (fc.to_exclude_button, FALSE);
- gtk_widget_set_sensitive (fc.apply, FALSE);
-
- face_apply.include = &fd_include;
- face_apply.exclude = &fd_exclude;
-
- xml_add_users = glade_helper_load ("gdmsetup.glade",
- "add_user_dialog",
- GTK_TYPE_DIALOG,
- TRUE);
-
- g_signal_connect (G_OBJECT (fc.include_add), "clicked",
- G_CALLBACK (users_add_button_clicked), &fd_include);
- g_signal_connect (fc.exclude_add, "clicked",
- G_CALLBACK (users_add_button_clicked), &fd_exclude);
- g_signal_connect (fc.include_del, "clicked",
- G_CALLBACK (face_del), &fd_include);
- g_signal_connect (fc.exclude_del, "clicked",
- G_CALLBACK (face_del), &fd_exclude);
-
- g_signal_connect (fc.include_model, "row-deleted",
- G_CALLBACK (face_rowdel), &fc);
- g_signal_connect (fc.exclude_model, "row-deleted",
- G_CALLBACK (face_rowdel), &fc);
-
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fc.include_treeview));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed",
- G_CALLBACK (face_selection_changed), &fd_include);
- selection = gtk_tree_view_get_selection (
- GTK_TREE_VIEW (fc.exclude_treeview));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed",
- G_CALLBACK (face_selection_changed), &fd_exclude);
-
- g_signal_connect (fc.to_include_button, "clicked",
- G_CALLBACK (browser_move), &fd_include);
- g_signal_connect (fc.to_exclude_button, "clicked",
- G_CALLBACK (browser_move), &fd_exclude);
-
- g_signal_connect (fc.apply, "clicked",
- G_CALLBACK (browser_apply), &fc);
-}
-
-static void
-include_all_toggle (GtkWidget *toggle)
-{
- if (GTK_TOGGLE_BUTTON (toggle)->active)
- GdmIncludeAll = TRUE;
- else
- GdmIncludeAll = FALSE;
-
- setup_user_combobox_list ("autologin_combo",
- GDM_KEY_AUTOMATIC_LOGIN);
- setup_user_combobox_list ("timedlogin_combo",
- GDM_KEY_TIMED_LOGIN);
-}
-
-static gboolean
-greeter_toggle_timeout (GtkWidget *toggle)
-{
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
- gboolean val = gdm_config_get_bool ((gchar *)key);
-
- if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
-
- if (strcmp (ve_sure_string (key), GDM_KEY_BACKGROUND_SCALE_TO_FIT) == 0) {
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
-
- GtkWidget *checkbutton;
-
- checkbutton = glade_helper_get (xml, "sg_scale_background_remote",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton),
- GTK_TOGGLE_BUTTON (toggle)->active);
- }
- else {
- GtkWidget *checkbutton;
-
- checkbutton = glade_helper_get (xml, "sg_scale_background",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton),
- GTK_TOGGLE_BUTTON (toggle)->active);
- }
- }
- gdm_setup_config_set_bool (key, GTK_TOGGLE_BUTTON (toggle)->active);
- update_greeters ();
-
- if (strcmp (ve_sure_string (key), GDM_KEY_INCLUDE_ALL) == 0) {
- include_all_toggle (toggle);
- }
- }
-
- return FALSE;
-}
-
-static void
-greeter_toggle_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 500, greeter_toggle_timeout);
-}
-
-static void
-sensitive_entry_toggled (GtkWidget *toggle, gpointer data)
-{
- GtkWidget *widget = data;
- gboolean val;
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle));
-
- if (val == FALSE) {
- gtk_widget_set_sensitive (widget, TRUE);
- } else {
- gtk_widget_set_sensitive (widget, FALSE);
- }
-
- run_timeout (toggle, 500, greeter_toggle_timeout);
-}
-
-static gboolean
-local_background_type_toggle_timeout (GtkWidget *toggle)
-{
- GtkWidget *color_radiobutton;
- GtkWidget *image_radiobutton;
- GtkWidget *color_remote_radiobutton;
- GtkWidget *image_remote_radiobutton;
- gboolean image_value;
- gboolean color_value;
-
- image_radiobutton = glade_helper_get (xml,
- "local_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- color_radiobutton = glade_helper_get (xml,
- "local_background_color_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- image_remote_radiobutton = glade_helper_get (xml,
- "remote_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- color_remote_radiobutton = glade_helper_get (xml,
- "remote_background_color_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
- image_value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (image_radiobutton));
- color_value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (color_radiobutton));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_remote_radiobutton), image_value);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_remote_radiobutton), color_value);
- }
- else {
- image_value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (image_remote_radiobutton));
- color_value = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (color_remote_radiobutton));
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), image_value);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), color_value);
- }
-
- if (image_value == TRUE && color_value == TRUE) {
- /* Image & color */
- gdm_setup_config_set_int (GDM_KEY_BACKGROUND_TYPE, 1);
- }
- else if (image_value == FALSE && color_value == TRUE) {
- /* Color only */
- gdm_setup_config_set_int (GDM_KEY_BACKGROUND_TYPE, 2);
- }
- else if (image_value == TRUE && color_value == FALSE) {
- /* Image only*/
- gdm_setup_config_set_int (GDM_KEY_BACKGROUND_TYPE, 3);
- }
- else {
- /* No Background */
- gdm_setup_config_set_int (GDM_KEY_BACKGROUND_TYPE, 0);
- }
-
- update_greeters ();
- return FALSE;
-}
-
-static void
-local_background_type_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 200, local_background_type_toggle_timeout);
-}
-
-static void
-setup_greeter_toggle (const char *name,
- const char *key)
-{
- GtkWidget *toggle = glade_helper_get (xml, name,
- GTK_TYPE_TOGGLE_BUTTON);
- gboolean val = gdm_config_get_bool ((gchar *)key);
-
- g_object_set_data_full (G_OBJECT (toggle), "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), val);
-
- if (strcmp ("sg_defaultwelcome", ve_sure_string (name)) == 0) {
- GtkWidget *welcome = glade_helper_get (xml,
- "welcome", GTK_TYPE_ENTRY);
- GtkWidget *custom = glade_helper_get (xml, "sg_customwelcome",
- GTK_TYPE_RADIO_BUTTON);
-
- gtk_widget_set_sensitive (welcome, !val);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (custom), !val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), welcome);
-
- } else if (strcmp ("sg_defaultwelcomeremote", ve_sure_string (name)) == 0) {
- GtkWidget *welcomeremote = glade_helper_get (xml,
- "welcomeremote", GTK_TYPE_ENTRY);
- GtkWidget *customremote = glade_helper_get (xml, "sg_customwelcomeremote",
- GTK_TYPE_RADIO_BUTTON);
-
- gtk_widget_set_sensitive (welcomeremote, !val);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (customremote), !val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), welcomeremote);
-
- } else if (strcmp ("fb_allusers", ve_sure_string (name)) == 0) {
-
- GtkWidget *fb_includetree = glade_helper_get (xml, "fb_include_treeview",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *fb_buttonbox = glade_helper_get (xml, "UsersButtonBox",
- GTK_TYPE_VBOX);
- GtkWidget *fb_includeadd = glade_helper_get (xml, "fb_includeadd",
- GTK_TYPE_BUTTON);
- GtkWidget *fb_includeremove = glade_helper_get (xml, "fb_includedelete",
- GTK_TYPE_BUTTON);
- GtkWidget *fb_includelabel = glade_helper_get (xml, "fb_includelabel",
- GTK_TYPE_LABEL);
-
- gtk_widget_set_sensitive (fb_buttonbox, !val);
- gtk_widget_set_sensitive (fb_includetree, !val);
- gtk_widget_set_sensitive (fb_includelabel, !val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), fb_buttonbox);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), fb_includetree);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), fb_includeadd);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (list_selection_toggled), fb_includeremove);
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (sensitive_entry_toggled), fb_includelabel);
- }
- else if (strcmp ("acc_sound_ready", ve_sure_string (name)) == 0) {
-
- GtkWidget *file_chooser;
- GtkWidget *play_button;
-
- file_chooser = glade_helper_get (xml,
- "acc_sound_ready_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- play_button = glade_helper_get (xml,
- "acc_soundtest_ready_button",
- GTK_TYPE_BUTTON);
-
- gtk_widget_set_sensitive (file_chooser, val);
- gtk_widget_set_sensitive (play_button, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), file_chooser);
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), play_button);
- }
- else if (strcmp ("acc_sound_success", ve_sure_string (name)) == 0) {
-
- GtkWidget *file_chooser;
- GtkWidget *play_button;
-
- file_chooser = glade_helper_get (xml, "acc_sound_success_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- play_button = glade_helper_get (xml, "acc_soundtest_success_button",
- GTK_TYPE_BUTTON);
-
- gtk_widget_set_sensitive (file_chooser, val);
- gtk_widget_set_sensitive (play_button, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), file_chooser);
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), play_button);
- }
- else if (strcmp ("acc_sound_failure", ve_sure_string (name)) == 0) {
-
- GtkWidget *file_chooser;
- GtkWidget *play_button;
-
- file_chooser = glade_helper_get (xml, "acc_sound_failure_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
- play_button = glade_helper_get (xml, "acc_soundtest_failure_button",
- GTK_TYPE_BUTTON);
-
- gtk_widget_set_sensitive (file_chooser, val);
- gtk_widget_set_sensitive (play_button, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), file_chooser);
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), play_button);
- }
- else if (strcmp ("local_logo_image_checkbutton", ve_sure_string (name)) == 0) {
-
- GtkWidget *file_chooser;
- GtkWidget *file_chooser_remote;
- GtkWidget *checkbutton;
-
- checkbutton = glade_helper_get (xml, "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- file_chooser = glade_helper_get (xml, "local_logo_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- file_chooser_remote = glade_helper_get (xml, "remote_logo_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (checkbutton), val);
- gtk_widget_set_sensitive (file_chooser, val);
-
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), file_chooser);
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_toggled_sensitivity_positive), file_chooser_remote);
- g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (logo_toggle_toggled), NULL);
- }
- g_signal_connect (G_OBJECT (toggle), "toggled",
- G_CALLBACK (greeter_toggle_toggled), NULL);
-}
-
-static gboolean
-greeter_color_timeout (GtkWidget *picker)
-{
- const char *key = g_object_get_data (G_OBJECT (picker), "key");
- GdkColor color_val;
- char *val, *color;
-
- gtk_color_button_get_color (GTK_COLOR_BUTTON (picker), &color_val);
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
-
- GtkWidget *colorbutton;
-
- if (strcmp (GDM_KEY_GRAPHICAL_THEMED_COLOR, ve_sure_string (key)) == 0) {
- colorbutton = glade_helper_get (xml, "remote_background_theme_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
- }
- else {
- colorbutton = glade_helper_get (xml, "remote_background_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
- }
- gtk_color_button_set_color (GTK_COLOR_BUTTON (colorbutton), &color_val);
- }
- else {
- GtkWidget *colorbutton;
-
- if (strcmp (GDM_KEY_GRAPHICAL_THEMED_COLOR, ve_sure_string (key)) == 0) {
- colorbutton = glade_helper_get (xml, "local_background_theme_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
- }
- else {
- colorbutton = glade_helper_get (xml, "local_background_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
- }
- gtk_color_button_set_color (GTK_COLOR_BUTTON (colorbutton), &color_val);
- }
-
- color = g_strdup_printf ("#%02x%02x%02x",
- (guint16)color_val.red / 256,
- (guint16)color_val.green / 256,
- (guint16)color_val.blue / 256);
-
- val = gdm_config_get_string ((gchar *)key);
-
- if (strcmp (ve_sure_string (val), ve_sure_string (color)) != 0) {
- gdm_setup_config_set_string (key, ve_sure_string (color));
- update_greeters ();
- }
-
- g_free (color);
-
- return FALSE;
-}
-
-static void
-greeter_color_changed (GtkWidget *picker,
- guint r, guint g, guint b, guint a)
-{
- run_timeout (picker, 500, greeter_color_timeout);
-}
-
-static void
-setup_greeter_color (const char *name,
- const char *key)
-{
- GtkWidget *picker = glade_helper_get (xml, name,
- GTK_TYPE_COLOR_BUTTON);
- char *val = gdm_config_get_string ((gchar *)key);
-
- g_object_set_data_full (G_OBJECT (picker),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- if (val != NULL) {
- GdkColor color;
-
- if (gdk_color_parse (val, &color)) {
- gtk_color_button_set_color (GTK_COLOR_BUTTON (picker), &color);
- }
- }
-
- g_signal_connect (G_OBJECT (picker), "color_set",
- G_CALLBACK (greeter_color_changed), NULL);
-}
-
-typedef enum {
- BACKIMAGE,
- LOGO
-} ImageType;
-
-typedef struct _ImageData {
- GtkWidget *image;
- gchar *filename;
- gchar *key;
-} ImageData;
-
-/*
- * Do we really want to throw away the user's translations just because they
- * changed the non-translated value?
- */
-static gboolean
-greeter_entry_untranslate_timeout (GtkWidget *entry)
-{
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- const char *key = g_object_get_data (G_OBJECT (entry), "key");
- const char *text;
-
- text = gtk_entry_get_text (GTK_ENTRY (entry));
-
- ve_config_delete_translations (custom_cfg, key);
- gdm_setup_config_set_string (key, (char *)ve_sure_string (text));
- update_greeters ();
-
- return FALSE;
-}
-
-
-static void
-greeter_entry_untranslate_changed (GtkWidget *entry)
-{
- run_timeout (entry, 500, greeter_entry_untranslate_timeout);
-}
-
-static void
-command_response (GtkWidget *button, gpointer data)
-{
-
- GtkWidget *chooser = NULL;
- GtkWidget *setup_dialog;
- gint response;
- gchar *filename;
-
- const gchar *key;
- gchar *value;
- GtkWidget *command_combobox;
- GtkWidget *command_entry = NULL;
- gint selected;
-
- setup_dialog = glade_helper_get (xml_commands, "commands_dialog", GTK_TYPE_WINDOW);
-
- /* first get the file */
- chooser = gtk_file_chooser_dialog_new (_("Select Command"),
- GTK_WINDOW (setup_dialog),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
-
- response = gtk_dialog_run (GTK_DIALOG (chooser));
-
- if (response != GTK_RESPONSE_OK) {
- gtk_widget_destroy (chooser);
- return;
- }
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
- gtk_widget_destroy (chooser);
-
- if (filename == NULL) {
-
- GtkWidget *dialog;
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("No file selected"),
- "");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return;
- }
-
- key = g_object_get_data (G_OBJECT (button), "key");
-
- /* Then according to the selected command
- append the chosen filepath onto the existing
- string */
-
- command_combobox = glade_helper_get (xml_commands,
- "cmd_type_combobox",
- GTK_TYPE_COMBO_BOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (command_combobox));
-
- if (selected == HALT_CMD)
- value = gdm_config_get_string (GDM_KEY_HALT);
- else if (selected == REBOOT_CMD)
- value = gdm_config_get_string (GDM_KEY_REBOOT);
- else if (selected == SUSPEND_CMD)
- value = gdm_config_get_string (GDM_KEY_SUSPEND);
- else {
- gchar *key_string;
- gint i;
-
- i = selected - CUSTOM_CMD;
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- value = gdm_config_get_string (key_string);
- g_free (key_string);
- }
-
- value = strings_list_add (value, filename, ";");
-
- if (strcmp (ve_sure_string (key), "add_hrs_cmd_button") == 0)
- command_entry = glade_helper_get (xml_commands, "hrs_cmd_path_entry", GTK_TYPE_ENTRY);
-
- else if (strcmp (ve_sure_string (key), "add_custom_cmd_button") == 0)
- command_entry = glade_helper_get (xml_commands, "custom_cmd_path_entry", GTK_TYPE_ENTRY);
-
-
- gtk_entry_set_text (GTK_ENTRY (command_entry), ve_sure_string (value));
-
- g_free (value);
- g_free (filename);
-}
-
-static void
-default_filechooser_response (GtkWidget *file_chooser, gpointer data)
-{
- gchar *filename;
- gchar *key;
- gchar *value;
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
- key = g_object_get_data (G_OBJECT (file_chooser), "key");
- value = gdm_config_get_string (key);
-
- if (strcmp (ve_sure_string (key), GDM_KEY_GLOBAL_FACE_DIR) == 0) {
- /* we need to append trailing / so it matches the default
- config values. This is not really necessary but makes
- things neater */
- gchar *corr_filename;
-
- corr_filename = g_strdup_printf("%s/", ve_sure_string (filename));
-
- if (strcmp (ve_sure_string (value), corr_filename) != 0)
- gdm_setup_config_set_string (key, corr_filename);
-
- g_free (corr_filename);
- }
- else {
- /* All other cases */
- if (strcmp (ve_sure_string (value), ve_sure_string (filename)) != 0)
- gdm_setup_config_set_string (key, ve_sure_string (filename));
- }
-
- g_free (filename);
- g_free (value);
-}
-
-static void
-setup_general_command_buttons (const char *name,
- const char *key)
-{
- GtkWidget *button = glade_helper_get (xml_commands, name, GTK_TYPE_BUTTON);
-
- g_object_set_data_full (G_OBJECT (button),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (command_response),
- NULL);
-}
-
-static void
-setup_greeter_untranslate_entry (const char *name,
- const char *key)
-{
- GtkWidget *entry = glade_helper_get (xml, name, GTK_TYPE_ENTRY);
- char *val;
-
- val = gdm_config_get_translated_string ((gchar *)key);
-
- g_object_set_data_full (G_OBJECT (entry),
- "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- gtk_entry_set_text (GTK_ENTRY (entry), ve_sure_string (val));
-
- g_signal_connect (G_OBJECT (entry), "changed",
- G_CALLBACK (greeter_entry_untranslate_changed),
- NULL);
-
- g_free (val);
-}
-
-#ifdef HAVE_LIBXDMCP
-static void
-xdmcp_button_clicked (void)
-{
- static GtkWidget *dialog = NULL;
-
- if (dialog == NULL) {
-
- GtkWidget *parent;
-
- xml_xdmcp = glade_helper_load ("gdmsetup.glade",
- "xdmcp_dialog",
- GTK_TYPE_DIALOG,
- TRUE);
-
- parent = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- dialog = glade_helper_get (xml_xdmcp, "xdmcp_dialog", GTK_TYPE_DIALOG);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-
- setup_xdmcp_notify_toggle ("honour_indirect", GDM_KEY_INDIRECT);
- setup_xdmcp_intspin ("udpport", GDM_KEY_UDP_PORT);
- setup_xdmcp_intspin ("maxpending", GDM_KEY_MAX_PENDING);
- setup_xdmcp_intspin ("maxpendingindirect", GDM_KEY_MAX_INDIRECT);
- setup_xdmcp_intspin ("maxremotesessions", GDM_KEY_MAX_SESSIONS);
- setup_xdmcp_intspin ("maxwait", GDM_KEY_MAX_WAIT);
- setup_xdmcp_intspin ("maxwaitindirect", GDM_KEY_MAX_WAIT_INDIRECT);
- setup_xdmcp_intspin ("displaysperhost", GDM_KEY_DISPLAYS_PER_HOST);
- setup_xdmcp_intspin ("pinginterval", GDM_KEY_PING_INTERVAL);
- }
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_hide (dialog);
-}
-#endif
-
-static void
-apply_command_changes (GObject *object, gint response, gpointer command_data)
-{
- GtkWidget *dialog = command_data;
-
- if (g_hash_table_size (GdmCommandChangesUnsaved) != 0 &&
- response != GTK_RESPONSE_HELP) {
-
- GtkWidget *prompt;
- gint response;
-
- prompt = ve_hig_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Apply the changes to commands before closing?"),
- _("If you don't apply, the changes made "
- "will be disregarded."));
-
- gtk_dialog_add_button (GTK_DIALOG (prompt), _("Close _without Applying"), GTK_RESPONSE_CLOSE);
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-apply", GTK_RESPONSE_APPLY);
-
- response = gtk_dialog_run (GTK_DIALOG (prompt));
- gtk_widget_destroy (prompt);
-
- if (response == GTK_RESPONSE_APPLY) {
- GtkWidget *apply_button;
-
- apply_button = glade_helper_get (xml_commands, "command_apply_button",
- GTK_TYPE_WIDGET);
- g_signal_emit_by_name (G_OBJECT (apply_button), "clicked");
- }
- else {
- /* Just to make sure */
- if (g_hash_table_size (GdmCommandChangesUnsaved) != 0)
- g_hash_table_remove_all (GdmCommandChangesUnsaved);
- }
- }
-}
-
-static void
-command_button_clicked (void)
-{
- static GtkWidget *dialog = NULL;
- GtkWidget *command_chooser = NULL;
- gint selected = -1;
- gint response;
-
- if (dialog == NULL) {
-
- GtkWidget *parent;
- GtkWidget *apply_command_changes_button;
- gint i;
-
- xml_commands = glade_helper_load ("gdmsetup.glade",
- "commands_dialog",
- GTK_TYPE_DIALOG,
- TRUE);
-
- command_chooser = glade_helper_get (xml_commands,
- "cmd_type_combobox",
- GTK_TYPE_COMBO_BOX);
-
- glade_helper_tagify_label (xml_commands, "custom_cmd_note_label", "i");
- glade_helper_tagify_label (xml_commands, "custom_cmd_note_label", "small");
-
- glade_helper_tagify_label (xml_commands, "hrs_path_label", "i");
- glade_helper_tagify_label (xml_commands, "hrs_path_label", "small");
- glade_helper_tagify_label (xml_commands, "custom_path_label", "i");
- glade_helper_tagify_label (xml_commands, "custom_path_label", "small");
- glade_helper_tagify_label (xml_commands, "label_label", "i");
- glade_helper_tagify_label (xml_commands, "label_label", "small");
- glade_helper_tagify_label (xml_commands, "lrlabel_label", "i");
- glade_helper_tagify_label (xml_commands, "lrlabel_label", "small");
- glade_helper_tagify_label (xml_commands, "text_label", "i");
- glade_helper_tagify_label (xml_commands, "text_label", "small");
- glade_helper_tagify_label (xml_commands, "tooltip_label", "i");
- glade_helper_tagify_label (xml_commands, "tooltip_label", "small");
- glade_helper_tagify_label (xml_commands, "persistent_label", "i");
- glade_helper_tagify_label (xml_commands, "persistent_label", "small");
- glade_helper_tagify_label (xml_commands, "norestart_label", "i");
- glade_helper_tagify_label (xml_commands, "norestart_label", "small");
-
- parent = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- dialog = glade_helper_get (xml_commands, "commands_dialog", GTK_TYPE_DIALOG);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-
- /* Set up unsaved changes storage container */
- GdmCommandChangesUnsaved = g_hash_table_new (g_str_hash, g_str_equal);
-
-
- /* Add halt, reboot and suspend commands */
- gtk_combo_box_append_text (GTK_COMBO_BOX (command_chooser), _("Halt command"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (command_chooser), _("Reboot command"));
- gtk_combo_box_append_text (GTK_COMBO_BOX (command_chooser), _("Suspend command"));
-
- /* Add all the custom commands */
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar *label = g_strdup_printf("Custom command %d", i);
- gtk_combo_box_append_text (GTK_COMBO_BOX (command_chooser), label);
- g_free (label);
- }
-
- g_object_set_data_full (G_OBJECT (command_chooser), "key",
- _("command_chooser_combobox"), (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (command_chooser), "changed",
- G_CALLBACK (combobox_changed), NULL);
-
- /* Lets setup handlers for all the entries
- They will be assigned exactly the same key and handler
- as their only functionality would be to notify about changes */
-
- setup_commands_text_entry ("hrs_cmd_path_entry", "hrs_custom_cmd");
- setup_commands_text_entry ("custom_cmd_path_entry", GDM_KEY_CUSTOM_CMD_TEMPLATE);
- setup_commands_text_entry ("custom_cmd_label_entry", GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE);
- setup_commands_text_entry ("custom_cmd_lrlabel_entry", GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE);
- setup_commands_text_entry ("custom_cmd_text_entry", GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE);
- setup_commands_text_entry ("custom_cmd_tooltip_entry", GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE);
-
- setup_commands_notify_toggle ("custom_cmd_persistent_checkbutton", GDM_KEY_CUSTOM_CMD_IS_PERSISTENT_TEMPLATE);
- setup_commands_notify_toggle ("custom_cmd_norestart_checkbutton", GDM_KEY_CUSTOM_CMD_NO_RESTART_TEMPLATE);
-
- /* Set up append command buttons */
- setup_general_command_buttons("hrs_command_add", "add_hrs_cmd_button");
- setup_general_command_buttons("custom_command_add", "add_custom_cmd_button");
-
- /* set up apply command changes button */
- apply_command_changes_button = glade_helper_get (xml_commands,
- "command_apply_button",
- GTK_TYPE_BUTTON);
- g_object_set_data_full (G_OBJECT (apply_command_changes_button), "key",
- g_strdup ("apply_command_changes"), (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (apply_command_changes_button), "clicked",
- G_CALLBACK (command_apply), command_chooser);
-
- gtk_widget_set_sensitive (apply_command_changes_button, FALSE);
-
-
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (apply_command_changes), dialog);
- }
- else {
- command_chooser = glade_helper_get (xml_commands,
- "cmd_type_combobox",
- GTK_TYPE_COMBO_BOX);
-
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (command_chooser));
-
- }
-
- /* Finally lets set our default choice */
- gtk_combo_box_set_active (GTK_COMBO_BOX (command_chooser), HALT_CMD);
- if (selected == last_selected_command)
- g_signal_emit_by_name (G_OBJECT (command_chooser), "changed");
-
- do {
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response == GTK_RESPONSE_HELP) {
- g_spawn_command_line_sync ("gnome-open ghelp:gdm", NULL, NULL,
- NULL, NULL);
- }
- } while (response != GTK_RESPONSE_CLOSE &&
- response != GTK_RESPONSE_DELETE_EVENT);
-
- gtk_widget_hide (dialog);
-}
-
-static void
-vt_spinbutton_activate (GtkWidget * widget,
- gpointer data)
-{
- GtkDialog * dialog = data;
- gtk_dialog_response (dialog, GTK_RESPONSE_OK);
-}
-
-static void
-setup_greeter_combobox (const char *name,
- const char *key)
-{
- GtkWidget *combobox = glade_helper_get (xml, name, GTK_TYPE_COMBO_BOX);
- char *greetval = g_strdup (gdm_config_get_string ((gchar *)key));
-
- if (greetval != NULL &&
- strcmp (ve_sure_string (greetval),
- LIBEXECDIR "/gdmlogin --disable-sound --disable-crash-dialog") == 0) {
- g_free (greetval);
- greetval = g_strdup (LIBEXECDIR "/gdmlogin");
- }
-
- /* Set initial state of local style combo box. */
- if (strcmp (ve_sure_string (key), GDM_KEY_GREETER) == 0) {
-
- if (strstr (greetval, "/gdmlogin") != NULL) {
-
- GtkWidget *local_plain_vbox;
- GtkWidget *local_themed_vbox;
- gboolean val;
-
- val = gdm_config_get_bool (GDM_KEY_BROWSER);
-
- local_plain_vbox = glade_helper_get (xml, "local_plain_properties_vbox",
- GTK_TYPE_VBOX);
- local_themed_vbox = glade_helper_get (xml, "local_themed_properties_vbox",
- GTK_TYPE_VBOX);
- if (val == FALSE) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), LOCAL_PLAIN);
- }
- else {
- gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), LOCAL_PLAIN_WITH_FACE);
- }
-
- gtk_widget_show (local_plain_vbox);
- gtk_widget_hide (local_themed_vbox);
- }
- else if (strstr (greetval, "/gdmgreeter") != NULL) {
-
- GtkWidget *local_plain_vbox;
- GtkWidget *local_themed_vbox;
-
- local_plain_vbox = glade_helper_get (xml, "local_plain_properties_vbox",
- GTK_TYPE_VBOX);
- local_themed_vbox = glade_helper_get (xml, "local_themed_properties_vbox",
- GTK_TYPE_VBOX);
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), LOCAL_THEMED);
- gtk_widget_hide (local_plain_vbox);
- gtk_widget_show (local_themed_vbox);
- }
- }
- /* Set initial state of remote style combo box. */
- else if (strcmp (ve_sure_string (key), GDM_KEY_REMOTE_GREETER) == 0) {
- refresh_remote_tab ();
- }
-
- g_object_set_data_full (G_OBJECT (combobox), "key",
- g_strdup (key), (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (combobox), "changed",
- G_CALLBACK (combobox_changed), NULL);
-
- g_free (greetval);
-}
-
-static void
-setup_xdmcp_support (void)
-{
- GtkWidget *xdmcp_button;
-
- xdmcp_button = glade_helper_get (xml, "xdmcp_configbutton",
- GTK_TYPE_BUTTON);
-#ifndef HAVE_LIBXDMCP
- /* HAVE_LIBXDMCP */
- gtk_widget_set_sensitive (xdmcp_button, FALSE);
-#else
- /* HAVE_LIBXDMCP */
- gtk_widget_set_sensitive (xdmcp_button, TRUE);
-#endif
-
-}
-
-static gboolean
-module_compare (const char *mod1, const char *mod2)
-{
- char *base1;
- char *base2;
- char *p;
- gboolean ret;
-
- /* first cannonify the names */
- base1 = g_path_get_basename (mod1);
- base2 = g_path_get_basename (mod2);
- if (strncmp (ve_sure_string (base1), "lib", 3) == 0)
- strcpy (base1, &base1[3]);
- if (strncmp (ve_sure_string (base2), "lib", 3) == 0)
- strcpy (base2, &base2[3]);
- p = strstr (base1, ".so");
- if (p != NULL)
- *p = '\0';
- p = strstr (base2, ".so");
- if (p != NULL)
- *p = '\0';
-
- ret = (strcmp (ve_sure_string (base1), ve_sure_string (base2)) == 0);
-
- g_free (base1);
- g_free (base2);
-
- return ret;
-}
-
-static gboolean
-modules_list_contains (const char *modules_list, const char *module)
-{
- char **vec;
- int i;
-
- if (ve_string_empty (modules_list))
- return FALSE;
-
- vec = g_strsplit (modules_list, ":", -1);
- if (vec == NULL)
- return FALSE;
-
- for (i = 0; vec[i] != NULL; i++) {
- if (module_compare (vec[i], module)) {
- g_strfreev (vec);
- return TRUE;
- }
- }
-
- g_strfreev (vec);
- return FALSE;
-}
-
-static gboolean
-themes_list_contains (const char *themes_list, const char *theme)
-{
- char **vec;
- int i;
-
- if (ve_string_empty (themes_list))
- return FALSE;
-
- vec = g_strsplit (themes_list, GDM_DELIMITER_THEMES, -1);
- if (vec == NULL)
- return FALSE;
-
- for (i = 0; vec[i] != NULL; i++) {
- if (strcmp (ve_sure_string (vec[i]), ve_sure_string (theme)) == 0) {
- g_strfreev (vec);
- return TRUE;
- }
- }
-
- g_strfreev (vec);
- return FALSE;
-}
-
-static char *
-modules_list_remove (char *modules_list, const char *module)
-{
- char **vec;
- GString *str;
- char *sep = "";
- int i;
-
- if (ve_string_empty (modules_list))
- return g_strdup ("");
-
- vec = g_strsplit (modules_list, ":", -1);
- if (vec == NULL)
- return g_strdup ("");
-
- str = g_string_new (NULL);
-
- for (i = 0; vec[i] != NULL; i++) {
- if ( ! module_compare (vec[i], module)) {
- g_string_append (str, sep);
- sep = ":";
- g_string_append (str, vec[i]);
- }
- }
-
- g_strfreev (vec);
-
- return g_string_free (str, FALSE);
-}
-
-/* This function concatenates *string onto *strings_list with the addition
- of *sep as a deliminator inbetween the strings_list and string, then
- returns a copy of the new strings_list. */
-static char *
-strings_list_add (char *strings_list, const char *string, const char *sep)
-{
- char *n;
- if (ve_string_empty (strings_list))
- n = g_strdup (string);
- else
- n = g_strconcat (strings_list, sep, string, NULL);
- g_free (strings_list);
- return n;
-}
-
-/* This function removes *string with the addition of *sep
- as a postfix deliminator the string from *strings_list, then
- returns a copy of the new strings_list. */
-static char *
-strings_list_remove (char *strings_list, const char *string, const char *sep)
-{
- char **actions;
- gint i;
- GString *msg;
- const char *separator = "";
- char *n;
-
- if (ve_string_empty (strings_list))
- return strings_list;
-
- msg = g_string_new ("");
-
- actions = g_strsplit (strings_list, sep, -1);
- for (i = 0; actions[i]; i++) {
- if (strncmp (actions[i], string, strlen (string)) == 0)
- continue;
- g_string_append_printf (msg, "%s%s", separator, actions[i]);
- separator = sep;
- }
- g_strfreev (actions);
- n = g_strdup (msg->str);
- g_string_free (msg, TRUE);
- g_free (strings_list);
- return n;
-}
-
-static void
-acc_modules_toggled (GtkWidget *toggle, gpointer data)
-{
- gboolean add_gtk_modules = gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
- char *modules_list = g_strdup (gdm_config_get_string (GDM_KEY_GTK_MODULES_LIST));
-
- /* first whack the modules from the list */
- modules_list = modules_list_remove (modules_list, "gail");
- modules_list = modules_list_remove (modules_list, "atk-bridge");
- modules_list = modules_list_remove (modules_list, "dwellmouselistener");
- modules_list = modules_list_remove (modules_list, "keymouselistener");
-
- if (GTK_TOGGLE_BUTTON (toggle)->active) {
- if ( ! add_gtk_modules) {
- g_free (modules_list);
- modules_list = NULL;
- }
-
- modules_list = strings_list_add (modules_list, "gail",
- GDM_DELIMITER_MODULES);
- modules_list = strings_list_add (modules_list, "atk-bridge",
- GDM_DELIMITER_MODULES);
- modules_list = strings_list_add (modules_list,
- LIBDIR "/gtk-2.0/modules/libkeymouselistener",
- GDM_DELIMITER_MODULES);
- modules_list = strings_list_add (modules_list,
- LIBDIR "/gtk-2.0/modules/libdwellmouselistener",
- GDM_DELIMITER_MODULES);
- add_gtk_modules = TRUE;
- }
-
- if (ve_string_empty (modules_list))
- add_gtk_modules = FALSE;
-
- gdm_setup_config_set_string (GDM_KEY_GTK_MODULES_LIST,
- ve_sure_string (modules_list));
- gdm_setup_config_set_bool (GDM_KEY_ADD_GTK_MODULES,
- add_gtk_modules);
-
- g_free (modules_list);
-}
-
-static void
-test_sound (GtkWidget *button, gpointer data)
-{
- GtkWidget *acc_sound_file_chooser = data;
- gchar *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (acc_sound_file_chooser));
- const char *argv[3];
-
- if ((filename == NULL) || g_access (filename, R_OK) != 0 ||
- ve_string_empty (GdmSoundProgram))
- return;
-
- argv[0] = GdmSoundProgram;
- argv[1] = filename;
- argv[2] = NULL;
-
- g_spawn_async ("/" /* working directory */,
- (char **)argv,
- NULL /* envp */,
- 0 /* flags */,
- NULL /* child setup */,
- NULL /* user data */,
- NULL /* child pid */,
- NULL /* error */);
-
- g_free (filename);
-}
-
-static void
-sound_response (GtkWidget *file_chooser, gpointer data)
-{
- gchar *filename;
- gchar *sound_key;
- gchar *value;
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
- sound_key = g_object_get_data (G_OBJECT (file_chooser), "key");
- value = gdm_config_get_string (sound_key);
-
- if (strcmp (ve_sure_string (value), ve_sure_string (filename)) != 0) {
- gdm_setup_config_set_string (sound_key,
- (char *)ve_sure_string (filename));
- update_greeters ();
- }
- g_free (filename);
-}
-
-static void
-setup_users_tab (void)
-{
- GtkFileFilter *filter;
- GtkWidget *default_face_filechooser;
- GtkWidget *default_face_checkbox;
- GtkWidget *global_face_dir_filechooser;
- GtkWidget *global_face_dir_checkbox;
- gchar *filename;
-
- setup_greeter_toggle ("fb_allusers",
- GDM_KEY_INCLUDE_ALL);
- setup_face ();
-
- /* Setup default face */
- default_face_filechooser = glade_helper_get (xml,
- "default_face_filechooser",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (default_face_filechooser), filter);
-
- filename = gdm_config_get_string (GDM_KEY_DEFAULT_FACE);
-
- default_face_checkbox = glade_helper_get (xml,
- "default_face_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
-
- if (!ve_string_empty (filename) && access (filename, R_OK|X_OK)) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (default_face_filechooser),
- filename);
-
- gtk_widget_set_sensitive (default_face_filechooser, TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (default_face_checkbox), TRUE);
-
- }
- else {
- gtk_widget_set_sensitive (default_face_filechooser, FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (default_face_checkbox), FALSE);
- }
-
- g_object_set_data_full (G_OBJECT (default_face_filechooser),
- "key", g_strdup (GDM_KEY_DEFAULT_FACE),
- (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (default_face_filechooser), "selection-changed",
- G_CALLBACK (default_filechooser_response),
- NULL);
-
- g_object_set_data_full (G_OBJECT (default_face_checkbox),
- "key", g_strdup (GDM_KEY_DEFAULT_FACE),
- (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (default_face_checkbox), "toggled",
- G_CALLBACK (toggle_toggled), default_face_checkbox);
- g_signal_connect (G_OBJECT (default_face_checkbox), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), default_face_filechooser);
-
- /* Setup global face dir */
- g_free (filename);
-
- global_face_dir_filechooser = glade_helper_get (xml,
- "global_face_dir_filechooser",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- filename = gdm_config_get_string (GDM_KEY_GLOBAL_FACE_DIR);
-
- global_face_dir_checkbox = glade_helper_get (xml,
- "global_face_dir_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- if (!ve_string_empty (filename) && access (filename, R_OK|X_OK) == 0) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (global_face_dir_filechooser),
- filename);
- gtk_widget_set_sensitive (global_face_dir_filechooser, TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (global_face_dir_checkbox), TRUE);
- }
- else {
- gtk_widget_set_sensitive (global_face_dir_filechooser, FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (global_face_dir_checkbox), FALSE);
- }
-
-
- g_object_set_data_full (G_OBJECT (global_face_dir_filechooser),
- "key", g_strdup (GDM_KEY_GLOBAL_FACE_DIR),
- (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (global_face_dir_filechooser), "selection-changed",
- G_CALLBACK (default_filechooser_response), NULL);
-
- g_object_set_data_full (G_OBJECT (global_face_dir_checkbox),
- "key", g_strdup (GDM_KEY_GLOBAL_FACE_DIR),
- (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (global_face_dir_checkbox), "toggled",
- G_CALLBACK (toggle_toggled), global_face_dir_checkbox);
- g_signal_connect (G_OBJECT (global_face_dir_checkbox), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), global_face_dir_filechooser);
- g_free (filename);
-}
-
-static void
-setup_accessibility_tab (void)
-{
- GtkWidget *enable_accessible_login;
- GtkWidget *access_sound_ready_file_chooser;
- GtkWidget *access_sound_ready_play_button;
- GtkWidget *access_sound_success_file_chooser;
- GtkWidget *access_sound_success_play_button;
- GtkWidget *access_sound_failure_file_chooser;
- GtkWidget *access_sound_failure_play_button;
- GtkFileFilter *all_sounds_filter;
- GtkFileFilter *all_files_filter;
- gboolean add_gtk_modules;
- gchar *gdm_key_sound_ready;
- gchar *gdm_key_sound_success;
- gchar *gdm_key_sound_failure;
- gchar *modules_list;
- gchar *value;
-
- enable_accessible_login =
- glade_helper_get (xml,
- "acc_modules",
- GTK_TYPE_CHECK_BUTTON);
-
- access_sound_ready_file_chooser =
- glade_helper_get (xml,
- "acc_sound_ready_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- access_sound_ready_play_button =
- glade_helper_get (xml,
- "acc_soundtest_ready_button",
- GTK_TYPE_BUTTON);
-
- access_sound_success_file_chooser =
- glade_helper_get (xml,
- "acc_sound_success_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- access_sound_success_play_button =
- glade_helper_get (xml,
- "acc_soundtest_success_button",
- GTK_TYPE_BUTTON);
-
- access_sound_failure_file_chooser =
- glade_helper_get (xml,
- "acc_sound_failure_button",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- access_sound_failure_play_button =
- glade_helper_get (xml,
- "acc_soundtest_failure_button",
- GTK_TYPE_BUTTON);
-
- setup_greeter_toggle ("acc_theme",
- GDM_KEY_ALLOW_GTK_THEME_CHANGE);
- setup_greeter_toggle ("acc_sound_ready",
- GDM_KEY_SOUND_ON_LOGIN);
- setup_greeter_toggle ("acc_sound_success",
- GDM_KEY_SOUND_ON_LOGIN_SUCCESS);
- setup_greeter_toggle ("acc_sound_failure",
- GDM_KEY_SOUND_ON_LOGIN_FAILURE);
-
- add_gtk_modules = gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
- modules_list = gdm_config_get_string (GDM_KEY_GTK_MODULES_LIST);
-
- if (!(add_gtk_modules &&
- modules_list_contains (modules_list, "gail") &&
- modules_list_contains (modules_list, "atk-bridge") &&
- modules_list_contains (modules_list, "dwellmouselistener") &&
- modules_list_contains (modules_list, "keymouselistener"))) {
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enable_accessible_login),
- FALSE);
- }
- else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (enable_accessible_login),
- TRUE);
- }
-
- all_sounds_filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (all_sounds_filter, _("Sounds"));
- gtk_file_filter_add_mime_type (all_sounds_filter, "audio/x-wav");
- gtk_file_filter_add_mime_type (all_sounds_filter, "application/ogg");
-
- all_files_filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (all_files_filter, _("All Files"));
- gtk_file_filter_add_pattern(all_files_filter, "*");
-
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_ready_file_chooser), all_sounds_filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_ready_file_chooser), all_files_filter);
-
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_success_file_chooser), all_sounds_filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_success_file_chooser), all_files_filter);
-
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_failure_file_chooser), all_sounds_filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (access_sound_failure_file_chooser), all_files_filter);
-
- value = gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE);
-
- if (value != NULL && *value != '\0') {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (access_sound_ready_file_chooser),
- value);
- }
- else {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (access_sound_ready_file_chooser),
- DATADIR"/sounds");
- }
-
- value = gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE);
-
- if (value != NULL && *value != '\0') {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (access_sound_success_file_chooser),
- value);
- }
- else {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (access_sound_success_file_chooser),
- DATADIR"/sounds");
- }
-
- value = gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE);
-
- if (value != NULL && *value != '\0') {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (access_sound_failure_file_chooser),
- value);
- }
- else {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (access_sound_failure_file_chooser),
- DATADIR"/sounds");
- }
-
- gdm_key_sound_ready = g_strdup (GDM_KEY_SOUND_ON_LOGIN_FILE);
-
- g_object_set_data (G_OBJECT (access_sound_ready_file_chooser), "key",
- gdm_key_sound_ready);
-
- gdm_key_sound_success = g_strdup (GDM_KEY_SOUND_ON_LOGIN_SUCCESS_FILE);
-
- g_object_set_data (G_OBJECT (access_sound_success_file_chooser), "key",
- gdm_key_sound_success);
-
- gdm_key_sound_failure = g_strdup (GDM_KEY_SOUND_ON_LOGIN_FAILURE_FILE);
-
- g_object_set_data (G_OBJECT (access_sound_failure_file_chooser), "key",
- gdm_key_sound_failure);
-
- g_signal_connect (G_OBJECT (enable_accessible_login), "toggled",
- G_CALLBACK (acc_modules_toggled), NULL);
- g_signal_connect (G_OBJECT (access_sound_ready_play_button), "clicked",
- G_CALLBACK (test_sound), access_sound_ready_file_chooser);
- g_signal_connect (G_OBJECT (access_sound_success_play_button), "clicked",
- G_CALLBACK (test_sound), access_sound_success_file_chooser);
- g_signal_connect (G_OBJECT (access_sound_failure_play_button), "clicked",
- G_CALLBACK (test_sound), access_sound_failure_file_chooser);
- g_signal_connect (G_OBJECT (access_sound_ready_file_chooser), "selection-changed",
- G_CALLBACK (sound_response), access_sound_ready_file_chooser);
- g_signal_connect (G_OBJECT (access_sound_success_file_chooser), "selection-changed",
- G_CALLBACK (sound_response), access_sound_success_file_chooser);
- g_signal_connect (G_OBJECT (access_sound_failure_file_chooser), "selection-changed",
- G_CALLBACK (sound_response), access_sound_failure_file_chooser);
-}
-
-static char *
-get_theme_dir (void)
-{
- /*
- * We always want to free the value returned from this function, since
- * we use strdup to build a reasonable value if the configuration value
- * is not good. So use g_strdup here.
- */
- char *theme_dir = g_strdup (gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME_DIR));
-
- if (theme_dir == NULL ||
- theme_dir[0] == '\0' ||
- g_access (theme_dir, R_OK) != 0) {
- theme_dir = g_strdup (DATADIR "/gdm/themes/");
- }
-
- return theme_dir;
-}
-
-static void
-textview_set_buffer (GtkTextView *view, const char *text)
-{
- GtkTextBuffer *buffer = gtk_text_view_get_buffer (view);
- gtk_text_buffer_set_text (buffer, text, -1);
-}
-
-/* Sets up the preview section of Themed Greeter page
- after a theme has been selected */
-static void
-gg_selection_changed (GtkTreeSelection *selection, gpointer data)
-{
- static gboolean FirstPass = TRUE;
- GtkWidget *label;
- GtkWidget *label_remote;
- GtkWidget *delete_button;
- GtkWidget *delete_button_remote;
- GtkTreeModel *model;
- GtkTreeIter iter;
- GtkTextBuffer *buffer_local, *buffer_remote;
- GtkTextIter iter_local, iter_remote;
- GValue value = {0, };
- gboolean GdmGraphicalThemeRand;
- gchar *str;
- gint selected = -1;
-
- delete_button = glade_helper_get (xml, "gg_delete_theme",
- GTK_TYPE_BUTTON);
- delete_button_remote = glade_helper_get (xml, "gg_delete_theme_remote",
- GTK_TYPE_BUTTON);
-
- if ( !gtk_tree_selection_get_selected (selection, &model, &iter)) {
- gtk_widget_set_sensitive (delete_button, FALSE);
- gtk_widget_set_sensitive (delete_button_remote, FALSE);
- return;
- }
-
- /* Default to allow deleting of themes */
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
-
- GtkWidget *theme_list;
- GtkWidget *local_combobox;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreePath *path;
-
- theme_list = glade_helper_get (xml, "gg_theme_list_remote",
- GTK_TYPE_TREE_VIEW);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list));
-
- local_combobox = glade_helper_get (xml, "gg_mode_combobox",
- GTK_TYPE_COMBO_BOX);
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (local_combobox));
-
- if (model != NULL) {
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
- if (path != NULL) {
- gtk_tree_selection_select_path (selection, path);
- if (GTK_WIDGET_REALIZED(theme_list)) {
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (theme_list),
- path, NULL, FALSE, 0.0, 0.0);
- }
- }
- }
- gtk_widget_set_sensitive (delete_button, TRUE);
- gtk_widget_set_sensitive (delete_button_remote, TRUE);
- }
- else {
- GtkWidget *theme_list;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreePath *path;
-
- theme_list = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list));
-
- if (model != NULL) {
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter);
- if (path != NULL) {
- gtk_tree_selection_select_path (selection, path);
- if (GTK_WIDGET_REALIZED(theme_list)) {
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (theme_list),
- path, NULL, FALSE, 0.0, 0.0);
- }
- }
- }
- gtk_widget_set_sensitive (delete_button, TRUE);
- gtk_widget_set_sensitive (delete_button_remote, TRUE);
- }
- /* Determine if the theme selected is currently active */
- GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
- if (GdmGraphicalThemeRand) {
- gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED_LIST, &value);
- } else {
- gtk_tree_model_get_value (model, &iter, THEME_COLUMN_SELECTED, &value);
-
- /* We might have "Random form selected" option selected, but no
- active themes there hence defaulting to "Selected only"
- Lets make this theme delete-able from "Random from selected"
- mode in this case */
- if (g_value_get_boolean (&value) && selected == RANDOM_THEME) {
- g_value_unset (&value);
- g_value_set_boolean (&value, FALSE);
- }
- }
-
- /* Do not allow deleting of active themes */
- if (g_value_get_boolean (&value)) {
- gtk_widget_set_sensitive (delete_button, FALSE);
- gtk_widget_set_sensitive (delete_button_remote, FALSE);
- }
- g_value_unset (&value);
-
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_AUTHOR,
- &value);
-
- if (!ve_string_empty (ve_sure_string (g_value_get_string (&value)))) {
- str = g_strconcat (ve_sure_string (g_value_get_string (&value)), NULL);
- }
- else {
- str = g_strconcat (_("None"), NULL);
- }
-
- label = glade_helper_get (xml, "gg_author_text_view",
- GTK_TYPE_TEXT_VIEW);
- label_remote = glade_helper_get (xml, "gg_author_text_view_remote",
- GTK_TYPE_TEXT_VIEW);
-
- textview_set_buffer (GTK_TEXT_VIEW (label), "");
- textview_set_buffer (GTK_TEXT_VIEW (label_remote), "");
-
- buffer_local = gtk_text_view_get_buffer (GTK_TEXT_VIEW (label));
- buffer_remote = gtk_text_view_get_buffer (GTK_TEXT_VIEW (label_remote));
- gtk_text_buffer_get_iter_at_offset (buffer_local, &iter_local, 0);
- gtk_text_buffer_get_iter_at_offset (buffer_remote, &iter_remote, 0);
-
- if (FirstPass == TRUE) {
- gtk_text_buffer_create_tag (buffer_local, "small",
- "scale", PANGO_SCALE_SMALL, NULL);
- gtk_text_buffer_create_tag (buffer_remote, "small",
- "scale", PANGO_SCALE_SMALL, NULL);
- }
-
- gtk_text_buffer_insert_with_tags_by_name (buffer_local, &iter_local,
- str, -1, "small", NULL);
- gtk_text_buffer_insert_with_tags_by_name (buffer_remote, &iter_remote,
- str, -1, "small", NULL);
- g_value_unset (&value);
- g_free (str);
-
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_COPYRIGHT,
- &value);
-
- label = glade_helper_get (xml, "gg_copyright_text_view",
- GTK_TYPE_TEXT_VIEW);
- label_remote = glade_helper_get (xml, "gg_copyright_text_view_remote",
- GTK_TYPE_TEXT_VIEW);
-
- textview_set_buffer (GTK_TEXT_VIEW (label), "");
- textview_set_buffer (GTK_TEXT_VIEW (label_remote), "");
-
- buffer_local = gtk_text_view_get_buffer (GTK_TEXT_VIEW (label));
- buffer_remote = gtk_text_view_get_buffer (GTK_TEXT_VIEW (label_remote));
-
- gtk_text_buffer_get_iter_at_offset (buffer_local, &iter_local, 0);
- gtk_text_buffer_get_iter_at_offset (buffer_remote, &iter_remote, 0);
- if (FirstPass == TRUE) {
- gtk_text_buffer_create_tag (buffer_local, "small",
- "scale", PANGO_SCALE_SMALL, NULL);
- gtk_text_buffer_create_tag (buffer_remote, "small",
- "scale", PANGO_SCALE_SMALL, NULL);
- }
-
- if (!ve_string_empty (ve_sure_string (g_value_get_string (&value)))) {
- str = g_strconcat (ve_sure_string (g_value_get_string (&value)), NULL);
- }
- else {
- str = g_strconcat (_("None"), NULL);
- }
-
- gtk_text_buffer_insert_with_tags_by_name (buffer_local, &iter_local,
- str, -1, "small", NULL);
- gtk_text_buffer_insert_with_tags_by_name (buffer_remote, &iter_remote,
- str, -1, "small", NULL);
-
- FirstPass = FALSE;
- g_value_unset (&value);
-}
-
-static GtkTreeIter *
-read_themes (GtkListStore *store, const char *theme_dir, DIR *dir,
- const char *select_item)
-{
- struct dirent *dent;
- GtkTreeIter *select_iter = NULL;
- GdkPixbuf *pb = NULL;
- gchar *markup = NULL;
- gchar * real_selected_themes = NULL;
-
- while ((dent = readdir (dir)) != NULL) {
- char *n, *file, *name, *desc, *author, *copyright, *ss;
- char *full;
- GtkTreeIter iter;
- gboolean sel_theme;
- gboolean sel_themes;
- VeConfig *theme_file;
- if (dent->d_name[0] == '.')
- continue;
- n = g_strconcat (theme_dir, "/", dent->d_name,
- "/GdmGreeterTheme.desktop", NULL);
- if (g_access (n, R_OK) != 0) {
- g_free (n);
- n = g_strconcat (theme_dir, "/", dent->d_name,
- "/GdmGreeterTheme.info", NULL);
- }
- if (g_access (n, R_OK) != 0) {
- g_free (n);
- continue;
- }
-
- theme_file = ve_config_new (n);
-
- file = gdm_get_theme_greeter (n, dent->d_name);
- full = g_strconcat (theme_dir, "/", dent->d_name,
- "/", file, NULL);
- if (g_access (full, R_OK) != 0) {
- g_free (file);
- g_free (full);
- g_free (n);
- continue;
- }
- g_free (full);
-
- if (selected_theme != NULL &&
- strcmp (ve_sure_string (dent->d_name), ve_sure_string (selected_theme)) == 0)
- sel_theme = TRUE;
- else
- sel_theme = FALSE;
-
- if (selected_themes != NULL &&
- themes_list_contains (selected_themes, dent->d_name)) {
- sel_themes = TRUE;
- /* It might be the case that the config option RandomThemes that
- do not longer exist in the theme dir. Here we rectifying that */
- real_selected_themes = strings_list_add (real_selected_themes,
- dent->d_name, GDM_DELIMITER_THEMES);
- }
- else
- sel_themes = FALSE;
-
- name = ve_config_get_translated_string
- (theme_file, "GdmGreeterTheme/Name");
- if (ve_string_empty (name)) {
- g_free (name);
- name = g_strdup (dent->d_name);
- }
-
- desc = ve_config_get_translated_string
- (theme_file, "GdmGreeterTheme/Description");
- author = ve_config_get_translated_string
- (theme_file, "GdmGreeterTheme/Author");
- copyright = ve_config_get_translated_string
- (theme_file, "GdmGreeterTheme/Copyright");
- ss = ve_config_get_translated_string
- (theme_file, "GdmGreeterTheme/Screenshot");
-
- ve_config_destroy (theme_file);
-
- if (ss != NULL)
- full = g_strconcat (theme_dir, "/", dent->d_name,
- "/", ss, NULL);
- else
- full = NULL;
-
- if ( ! ve_string_empty (full) &&
- g_access (full, R_OK) == 0) {
-
- pb = gdk_pixbuf_new_from_file (full, NULL);
- if (pb != NULL) {
- if (gdk_pixbuf_get_width (pb) > 64 ||
- gdk_pixbuf_get_height (pb) > 50) {
- GdkPixbuf *pb2;
- pb2 = gdk_pixbuf_scale_simple
- (pb, 64, 50,
- GDK_INTERP_BILINEAR);
- g_object_unref (G_OBJECT (pb));
- pb = pb2;
- }
- }
- }
-
- markup = g_markup_printf_escaped ("<b>%s</b>\n<small>%s</small>", name, desc);
- gtk_list_store_append (store, &iter);
- gtk_list_store_set (store, &iter,
- THEME_COLUMN_SELECTED, sel_theme,
- THEME_COLUMN_SELECTED_LIST, sel_themes,
- THEME_COLUMN_DIR, dent->d_name,
- THEME_COLUMN_FILE, file,
- THEME_COLUMN_SCREENSHOT, pb,
- THEME_COLUMN_MARKUP, markup,
- THEME_COLUMN_NAME, name,
- THEME_COLUMN_DESCRIPTION, desc,
- THEME_COLUMN_AUTHOR, author,
- THEME_COLUMN_COPYRIGHT, copyright,
- -1);
-
- if (select_item != NULL &&
- strcmp (ve_sure_string (dent->d_name), ve_sure_string (select_item)) == 0) {
- /* anality */ g_free (select_iter);
- select_iter = g_new0 (GtkTreeIter, 1);
- *select_iter = iter;
- }
-
- g_free (file);
- g_free (name);
- g_free (markup);
- g_free (desc);
- g_free (author);
- g_free (copyright);
- g_free (ss);
- g_free (full);
- g_free (n);
- }
-
- g_free (selected_themes);
- selected_themes = g_strdup (real_selected_themes);
- g_free (real_selected_themes);
-
- return select_iter;
-}
-
-static gboolean
-greeter_theme_timeout (GtkWidget *toggle)
-{
- char *theme;
- char *themes;
-
- theme = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME);
- themes = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMES);
-
- /* If no checkbox themes selected */
- if (selected_themes == NULL)
- selected_themes = "";
-
- /* If themes have changed from the custom_config file, update it. */
- if (strcmp (ve_sure_string (theme),
- ve_sure_string (selected_theme)) != 0) {
-
- gdm_setup_config_set_string (GDM_KEY_GRAPHICAL_THEME,
- selected_theme);
- update_greeters ();
- }
-
- if (strcmp (ve_sure_string (themes),
- ve_sure_string (selected_themes)) != 0) {
-
- gdm_setup_config_set_string (GDM_KEY_GRAPHICAL_THEMES,
- selected_themes);
-
- /* This should only be executed if we dealing with
- random theme setting. If no random themes are present and
- the random theme option was set to true we force it to be false.
- If there is at least one random theme selected and the random
- theme option was false we force it to be true */
- if (ve_string_empty (selected_themes) &&
- gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND)) {
- gdm_setup_config_set_bool (GDM_KEY_GRAPHICAL_THEME_RAND, FALSE);
- GdmRandomFromSelectedChangesWarn = TRUE;
-
- } else if (!ve_string_empty (selected_themes) &&
- !gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND)) {
- gdm_setup_config_set_bool (GDM_KEY_GRAPHICAL_THEME_RAND, TRUE);
- GdmRandomFromSelectedChangesWarn = FALSE;
- }
-
- update_greeters ();
- }
-
- return FALSE;
-}
-
-static void
-selected_toggled (GtkCellRendererToggle *cell,
- char *path_str,
- gpointer data)
-{
- gchar *theme_name = NULL;
- GtkTreeModel *model = GTK_TREE_MODEL (data);
- GtkTreeIter selected_iter;
- GtkTreeIter iter;
- GtkTreePath *path;
- GtkTreePath *sel_path = gtk_tree_path_new_from_string (path_str);
- GtkWidget *theme_list = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *del_button = glade_helper_get (xml, "gg_delete_theme",
- GTK_TYPE_BUTTON);
- GtkWidget *del_button_remote = glade_helper_get (xml, "gg_delete_theme_remote",
- GTK_TYPE_BUTTON);
- gboolean is_radio;
-
- gtk_tree_model_get_iter (model, &selected_iter, sel_path);
- path = gtk_tree_path_new_first ();
- is_radio = gtk_cell_renderer_toggle_get_radio (cell);
-
- if (is_radio) { /* Radiobuttons */
- /* Clear list of all selected themes */
- g_free (selected_theme);
-
- /* Get the new selected theme */
- gtk_tree_model_get (model, &selected_iter,
- THEME_COLUMN_DIR, &selected_theme, -1);
-
- /* Loop through all themes in list */
- while (gtk_tree_model_get_iter (model, &iter, path)) {
- /* If this toggle was just toggled */
- if (gtk_tree_path_compare (path, sel_path) == 0) {
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- THEME_COLUMN_SELECTED, TRUE,
- -1); /* Toggle ON */
- gtk_widget_set_sensitive (del_button, FALSE);
- gtk_widget_set_sensitive (del_button_remote, FALSE);
- } else {
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- THEME_COLUMN_SELECTED, FALSE,
- -1); /* Toggle OFF */
- }
-
- gtk_tree_path_next (path);
- }
- } else { /* Checkboxes */
-
- /* Clear list of all selected themes */
- g_free (selected_themes);
- selected_themes = NULL;
-
- /* Loop through all checkboxes */
- while (gtk_tree_model_get_iter (model, &iter, path)) {
- gboolean selected = FALSE;
-
- /* If this checkbox was just toggled */
- if (gtk_tree_path_compare (path, sel_path) == 0) {
-
- gtk_tree_model_get (model, &selected_iter,
- THEME_COLUMN_DIR, &theme_name, -1);
- if (gtk_cell_renderer_toggle_get_active (cell)) {
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- THEME_COLUMN_SELECTED_LIST,
- FALSE, -1); /* Toggle OFF */
- /* We will only make a theme delete-able if its not the
- selected theme from single the theme mode */
- gtk_widget_set_sensitive (del_button, TRUE);
- gtk_widget_set_sensitive (del_button_remote, TRUE);
- } else {
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
- THEME_COLUMN_SELECTED_LIST,
- TRUE, -1); /* Toggle ON */
- gtk_widget_set_sensitive (del_button, FALSE);
- gtk_widget_set_sensitive (del_button_remote, FALSE);
- }
- }
-
- gtk_tree_model_get (model, &iter, THEME_COLUMN_SELECTED_LIST,
- &selected, THEME_COLUMN_DIR, &theme_name, -1);
-
- if (selected)
- selected_themes = strings_list_add (selected_themes,
- theme_name, GDM_DELIMITER_THEMES);
-
- g_free (theme_name);
- gtk_tree_path_next (path);
- }
-
- if (selected_themes == NULL)
- selected_themes = g_strdup("");
-
- /* There are no themes selected atm in the Random form selected mode.
- We need to inform users that is the case */
- if (ve_string_empty (selected_themes)) {
- GtkWidget *setup_dialog = glade_helper_get(xml,
- "setup_dialog", GTK_TYPE_WINDOW);
-
- GtkWidget *dlg =
- ve_hig_dialog_new (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("No themes selected!"),
- _("You need one or more themes selected for "
- "the \"Random from selected\" option to be "
- "valid. Failure to do so will force "
- "\"Selected only\" mode."));
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- }
- }
-
- gtk_tree_path_free (path);
- gtk_tree_path_free (sel_path);
-
- run_timeout (theme_list, 500, greeter_theme_timeout);
-}
-
-static gboolean
-is_ext (gchar *filename, const char *ext)
-{
- const char *dot;
-
- dot = strrchr (filename, '.');
- if (dot == NULL)
- return FALSE;
-
- if (strcmp (ve_sure_string (dot), ve_sure_string (ext)) == 0)
- return TRUE;
- else
- return FALSE;
-}
-
-/* sense the right unzip program */
-static char *
-find_unzip (gchar *filename)
-{
- char *prog;
- char *tryg[] = {
- "/bin/gunzip",
- "/usr/bin/gunzip",
- NULL };
- char *tryb[] = {
- "/bin/bunzip2",
- "/usr/bin/bunzip2",
- NULL };
- int i;
-
- if (is_ext (filename, ".bz2")) {
- prog = g_find_program_in_path ("bunzip2");
- if (prog != NULL)
- return prog;
-
- for (i = 0; tryb[i] != NULL; i++) {
- if (g_access (tryb[i], X_OK) == 0)
- return g_strdup (tryb[i]);
- }
- }
-
- prog = g_find_program_in_path ("gunzip");
- if (prog != NULL)
- return prog;
-
- for (i = 0; tryg[i] != NULL; i++) {
- if (g_access (tryg[i], X_OK) == 0)
- return g_strdup (tryg[i]);
- }
- /* Hmmm, fallback */
- return g_strdup ("/bin/gunzip");
-}
-
-static char *
-find_tar (void)
-{
- char *tar_prog;
- char *try[] = {
- "/bin/gtar",
- "/bin/tar",
- "/usr/bin/gtar",
- "/usr/bin/tar",
- NULL };
- int i;
-
- tar_prog = g_find_program_in_path ("gtar");
- if (tar_prog != NULL)
- return tar_prog;
-
- tar_prog = g_find_program_in_path ("tar");
- if (tar_prog != NULL)
- return tar_prog;
-
- for (i = 0; try[i] != NULL; i++) {
- if (g_access (try[i], X_OK) == 0)
- return g_strdup (try[i]);
- }
- /* Hmmm, fallback */
- return g_strdup ("/bin/tar");
-}
-
-static char *
-find_chmod (void)
-{
- char *chmod_prog;
- char *try[] = {
- "/bin/chmod",
- "/sbin/chmod",
- "/usr/bin/chmod",
- "/usr/sbin/chmod",
- NULL };
- int i;
-
- chmod_prog = g_find_program_in_path ("chmod");
- if (chmod_prog != NULL)
- return chmod_prog;
-
- for (i = 0; try[i] != NULL; i++) {
- if (g_access (try[i], X_OK) == 0)
- return g_strdup (try[i]);
- }
- /* Hmmm, fallback */
- return g_strdup ("/bin/chmod");
-}
-
-static char *
-find_chown (void)
-{
- char *chown_prog;
- char *try[] = {
- "/bin/chown",
- "/sbin/chown",
- "/usr/bin/chown",
- "/usr/sbin/chown",
- NULL };
- int i;
-
- chown_prog = g_find_program_in_path ("chown");
- if (chown_prog != NULL)
- return chown_prog;
-
- for (i = 0; try[i] != NULL; i++) {
- if (g_access (try[i], X_OK) == 0)
- return g_strdup (try[i]);
- }
- /* Hmmm, fallback */
- return g_strdup ("/bin/chown");
-}
-
-
-static char *
-get_the_dir (FILE *fp, char **error)
-{
- char buf[2048];
- char *dir = NULL;
- int dirlen = 0;
- gboolean got_info = FALSE;
- gboolean read_a_line = FALSE;
-
- while (fgets (buf, sizeof (buf), fp) != NULL) {
- char *p, *s;
-
- read_a_line = TRUE;
-
- p = strchr (buf, '\n');
- if (p != NULL)
- *p = '\0';
- if (dir == NULL) {
- p = strchr (buf, '/');
- if (p != NULL)
- *p = '\0';
- dir = g_strdup (buf);
- if (p != NULL)
- *p = '/';
- dirlen = strlen (dir);
-
- if (dirlen < 1) {
- *error =
- _("Archive is not of a subdirectory");
-
- g_free (dir);
- return NULL;
- }
- }
-
- if (strncmp (ve_sure_string (buf), ve_sure_string (dir), dirlen) != 0) {
- *error = _("Archive is not of a single subdirectory");
- g_free (dir);
- return NULL;
- }
-
- if ( ! got_info) {
- s = g_strconcat (dir, "/GdmGreeterTheme.info", NULL);
- if (strcmp (ve_sure_string (buf), ve_sure_string (s)) == 0)
- got_info = TRUE;
- g_free (s);
- }
-
- if ( ! got_info) {
- s = g_strconcat (dir, "/GdmGreeterTheme.desktop", NULL);
- if (strcmp (ve_sure_string (buf), ve_sure_string (s)) == 0)
- got_info = TRUE;
- g_free (s);
- }
- }
-
- if (got_info)
- return dir;
-
- if ( ! read_a_line)
- *error = _("File not a tar.gz or tar archive");
- else
- *error = _("Archive does not include a "
- "GdmGreeterTheme.info file");
-
- g_free (dir);
- return NULL;
-}
-
-static char *
-get_archive_dir (gchar *filename, char **untar_cmd, char **error)
-{
- char *quoted;
- char *tar;
- char *unzip;
- char *cmd;
- char *dir;
- FILE *fp;
-
- *untar_cmd = NULL;
-
- *error = NULL;
-
- if (g_access (filename, F_OK) != 0) {
- *error = _("File does not exist");
- return NULL;
- }
-
- /* Note that this adds './' In front to avoid troubles */
- quoted = ve_shell_quote_filename (filename);
- tar = find_tar ();
- unzip = find_unzip (filename);
-
- cmd = g_strdup_printf ("%s -c %s | %s -tf -", unzip, quoted, tar);
- fp = popen (cmd, "r");
- g_free (cmd);
- if (fp != NULL) {
- int ret;
- dir = get_the_dir (fp, error);
- ret = pclose (fp);
- if (ret == 0 && dir != NULL) {
- *untar_cmd = g_strdup_printf ("%s -c %s | %s -xf -",
- unzip, quoted, tar);
- g_free (tar);
- g_free (unzip);
- g_free (quoted);
- return dir;
- } else {
- *error = NULL;
- }
- g_free (dir);
- }
-
- /* error due to command failing */
- if (*error == NULL) {
- /* Try uncompressed? */
- cmd = g_strdup_printf ("%s -tf %s", tar, quoted);
- fp = popen (cmd, "r");
- g_free (cmd);
- if (fp != NULL) {
- int ret;
- dir = get_the_dir (fp, error);
- ret = pclose (fp);
- if (ret == 0 && dir != NULL) {
- *untar_cmd = g_strdup_printf ("%s -xf %s",
- tar, quoted);
- g_free (tar);
- g_free (unzip);
- g_free (quoted);
- return dir;
- } else {
- *error = NULL;
- }
- g_free (dir);
- }
- }
-
- if (*error == NULL)
- *error = _("File not a tar.gz or tar archive");
-
- g_free (tar);
- g_free (unzip);
- g_free (quoted);
-
- return NULL;
-}
-
-static gboolean
-dir_exists (const char *parent, const char *dir)
-{
- DIR *dp = opendir (parent);
- struct dirent *dent;
-
- if (dp == NULL)
- return FALSE;
-
- while ((dent = readdir (dp)) != NULL) {
- if (strcmp (ve_sure_string (dent->d_name), ve_sure_string (dir)) == 0) {
- closedir (dp);
- return TRUE;
- }
- }
- closedir (dp);
- return FALSE;
-}
-
-static void
-install_theme_file (gchar *filename, GtkListStore *store, GtkWindow *parent)
-{
- GtkTreeSelection *selection;
- GtkTreeIter *select_iter = NULL;
- GtkWidget *theme_list;
- DIR *dp;
- gchar *cwd;
- gchar *dir;
- gchar *error;
- gchar *theme_dir;
- gchar *untar_cmd;
- gboolean success = FALSE;
-
- theme_list = glade_helper_get (xml, "gg_theme_list", GTK_TYPE_TREE_VIEW);
-
- cwd = g_get_current_dir ();
- theme_dir = get_theme_dir ();
-
- if ( !g_path_is_absolute (filename)) {
-
- gchar *temp;
-
- temp = g_build_filename (cwd, filename, NULL);
- g_free (filename);
- filename = temp;
- }
-
- dir = get_archive_dir (filename, &untar_cmd, &error);
-
- /* FIXME: perhaps do a little bit more sanity checking of
- * the archive */
-
- if (dir == NULL) {
-
- GtkWidget *dialog;
- gchar *msg;
-
- msg = g_strdup_printf (_("%s"), error);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Not a theme archive"),
- msg);
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (theme_dir);
- g_free (untar_cmd);
- g_free (cwd);
- g_free (msg);
- return;
- }
-
- if (dir_exists (theme_dir, dir)) {
-
- GtkWidget *button;
- GtkWidget *dialog;
- gchar *fname;
- gchar *s;
-
- fname = ve_filename_to_utf8 (dir);
-
- /* FIXME: if exists already perhaps we could also have an
- * option to change the dir name */
- s = g_strdup_printf (_("Theme directory '%s' seems to be already "
- "installed. Install again anyway?"),
- fname);
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- s,
- "");
- g_free (fname);
- g_free (s);
-
- button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_NO);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
-
- button = gtk_button_new_from_stock ("_Install Anyway");
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_YES);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_YES);
-
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_YES) {
- gtk_widget_destroy (dialog);
- g_free (theme_dir);
- g_free (untar_cmd);
- g_free (cwd);
- g_free (dir);
- return;
- }
- gtk_widget_destroy (dialog);
- }
-
- g_assert (untar_cmd != NULL);
-
- if (g_chdir (theme_dir) == 0 &&
- /* this is a security sanity check */
- strchr (dir, '/') == NULL &&
- system (untar_cmd) == 0) {
-
- gchar *argv[5];
- gchar *quoted;
- gchar *chown;
- gchar *chmod;
-
- quoted = g_strconcat ("./", dir, NULL);
- chown = find_chown ();
- chmod = find_chmod ();
- success = TRUE;
-
- /* HACK! */
- argv[0] = chown;
- argv[1] = "-R";
- argv[2] = "root:root";
- argv[3] = quoted;
- argv[4] = NULL;
- simple_spawn_sync (argv);
-
- argv[0] = chmod;
- argv[1] = "-R";
- argv[2] = "a+r";
- argv[3] = quoted;
- argv[4] = NULL;
- simple_spawn_sync (argv);
-
- argv[0] = chmod;
- argv[1] = "a+x";
- argv[2] = quoted;
- argv[3] = NULL;
- simple_spawn_sync (argv);
-
- g_free (quoted);
- g_free (chown);
- g_free (chmod);
- }
-
- if (!success) {
-
- GtkWidget *dialog;
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Some error occurred when "
- "installing the theme"),
- "");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- }
-
- gtk_list_store_clear (store);
-
- dp = opendir (theme_dir);
-
- if (dp != NULL) {
- select_iter = read_themes (store, theme_dir, dp, dir);
- closedir (dp);
- }
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
-
- if (select_iter != NULL) {
- gtk_tree_selection_select_iter (selection, select_iter);
- g_free (select_iter);
- }
-
- g_free (untar_cmd);
- g_free (theme_dir);
- g_free (dir);
- g_free (cwd);
-}
-
-static void
-theme_install_response (GtkWidget *chooser, gint response, gpointer data)
-{
- GtkListStore *store = data;
- gchar *filename;
-
- if (response != GTK_RESPONSE_OK) {
- gtk_widget_destroy (chooser);
- return;
- }
-
- if (last_theme_installed != NULL) {
- g_free (last_theme_installed);
- }
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (chooser));
- last_theme_installed = g_strdup (filename);
-
- if (filename == NULL) {
-
- GtkWidget *dialog;
-
- dialog = ve_hig_dialog_new (GTK_WINDOW (chooser),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("No file selected"),
- "");
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- return;
- }
-
- install_theme_file (filename, store, GTK_WINDOW (chooser));
- gtk_widget_destroy (chooser);
- g_free (filename);
-}
-
-static void
-install_new_theme (GtkWidget *button, gpointer data)
-{
- GtkListStore *store = data;
- static GtkWidget *chooser = NULL;
- GtkWidget *setup_dialog;
-
- setup_dialog = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
-
- chooser = gtk_file_chooser_dialog_new (_("Select Theme Archive"),
- GTK_WINDOW (setup_dialog),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- _("_Install"), GTK_RESPONSE_OK,
- NULL);
-
- gtk_file_chooser_set_show_hidden (GTK_FILE_CHOOSER (chooser), FALSE);
-
- g_signal_connect (G_OBJECT (chooser), "destroy",
- G_CALLBACK (gtk_widget_destroyed), &chooser);
- g_signal_connect (G_OBJECT (chooser), "response",
- G_CALLBACK (theme_install_response), store);
-
- if (last_theme_installed != NULL) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (chooser),
- last_theme_installed);
- }
- gtk_widget_show (chooser);
-}
-
-static void
-delete_theme (GtkWidget *button, gpointer data)
-{
- GtkListStore *store = data;
- GtkWidget *theme_list;
- GtkWidget *theme_list_remote;
- GtkWidget *setup_dialog;
- GtkWidget *del_button;
- GtkWidget *del_button_remote;
- GtkWidget *local_combobox;
- GtkTreeSelection *selection;
- char *dir, *name;
- GtkTreeModel *model;
- GtkTreeIter iter;
- GValue value = {0, };
- GtkWidget *dlg;
- char *s;
- gboolean GdmGraphicalThemeRand;
- gboolean selected_warning = FALSE;
- gint selected = -1;
-
- setup_dialog = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- theme_list = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- theme_list_remote = glade_helper_get (xml, "gg_theme_list_remote",
- GTK_TYPE_TREE_VIEW);
- del_button = glade_helper_get (xml, "gg_delete_theme",
- GTK_TYPE_BUTTON);
- del_button_remote = glade_helper_get (xml, "gg_delete_theme_remote",
- GTK_TYPE_BUTTON);
- local_combobox = glade_helper_get (xml, "gg_mode_combobox",
- GTK_TYPE_COMBO_BOX);
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- }
- else {
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list_remote));
- }
-
- if ( ! gtk_tree_selection_get_selected (selection, &model, &iter)) {
- /* should never get here since the button shuld not be
- * enabled */
- return;
- }
-
- GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
-
- if (GdmGraphicalThemeRand) {
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED_LIST, &value);
-
- /* Make sure that the theme is not selected in the
- single theme mode */
- if (!g_value_get_boolean (&value)) {
- g_value_unset (&value);
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED, &value);
-
- if (g_value_get_boolean (&value))
- selected_warning = TRUE;
- }
- }
- else {
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_SELECTED,
- &value);
-
- /* We might have "Random form selected" option selected, but no
- active themes there hence defaulting to "Selected only"
- Lets make this theme delete-able from "Random from selected"
- mode in this case */
- selected = gtk_combo_box_get_active (GTK_COMBO_BOX (local_combobox));
-
- if (g_value_get_boolean (&value) && selected == RANDOM_THEME)
- selected_warning = TRUE;
- }
-
- /* The theme we trying to delete in "Random from selected"
- mode is currently in use in the "Selected only" mode
- so lets warn the user about it */
- if (selected_warning == TRUE) {
- dlg = ve_hig_dialog_new (GTK_WINDOW (setup_dialog) /* parent */,
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Theme active in \"Selected only\" mode"),
- _("This theme cannot be deleted at this point. "
- "If you wish to delete this theme switch to "
- "\"Selected only\" mode, and deselect it by "
- "choosing a different theme."));
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- }
-
- /* Do not allow deleting of selected theme */
- if (g_value_get_boolean (&value)) {
- /* should never get here since the button shuld not be
- * enabled */
- g_value_unset (&value);
- return;
- }
- g_value_unset (&value);
-
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_NAME,
- &value);
- name = g_strdup (g_value_get_string (&value));
- g_value_unset (&value);
-
- gtk_tree_model_get_value (model, &iter,
- THEME_COLUMN_DIR,
- &value);
- dir = g_strdup (g_value_get_string (&value));
- g_value_unset (&value);
-
- s = g_strdup_printf (_("Remove the \"%s\" theme?"),
- name);
- dlg = ve_hig_dialog_new
- (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- s,
- _("If you choose to remove the theme, it will be permanently lost."));
- g_free (s);
-
- button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
- gtk_dialog_add_action_widget (GTK_DIALOG (dlg), button, GTK_RESPONSE_NO);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
-
- button = gtk_button_new_from_stock (_("_Remove Theme"));
- gtk_dialog_add_action_widget (GTK_DIALOG (dlg), button, GTK_RESPONSE_YES);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dlg),
- GTK_RESPONSE_YES);
-
- if (gtk_dialog_run (GTK_DIALOG (dlg)) == GTK_RESPONSE_YES) {
- char *theme_dir = get_theme_dir ();
- char *cwd = g_get_current_dir ();
- if (g_chdir (theme_dir) == 0 &&
- /* this is a security sanity check, since we're doing rm -fR */
- strchr (dir, '/') == NULL) {
- /* HACK! */
- DIR *dp;
- char *argv[4];
- GtkTreeIter *select_iter = NULL;
- argv[0] = "/bin/rm";
- argv[1] = "-fR";
- argv[2] = g_strconcat ("./", dir, NULL);
- argv[3] = NULL;
- simple_spawn_sync (argv);
- g_free (argv[2]);
-
- /* Update the list */
- gtk_list_store_clear (store);
-
- dp = opendir (theme_dir);
-
- if (dp != NULL) {
- select_iter = read_themes (store, theme_dir, dp,
- selected_theme);
- closedir (dp);
- }
-
- if (select_iter != NULL) {
- gtk_tree_selection_select_iter (selection, select_iter);
- g_free (select_iter);
- }
-
- }
- g_chdir (cwd);
- g_free (cwd);
- g_free (theme_dir);
- }
- gtk_widget_destroy (dlg);
-
- g_free (name);
- g_free (dir);
-}
-
-static gboolean
-xserver_entry_timeout (GtkWidget *entry)
-{
- GtkWidget *mod_combobox;
- GSList *li;
- const char *key = g_object_get_data (G_OBJECT (entry), "key");
- const char *text = gtk_entry_get_text (GTK_ENTRY (entry));
- gchar *string_old = NULL;
- gchar *section;
-
- mod_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
-
- /* Get xserver section to update */
- section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (mod_combobox));
-
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
- if (strcmp (ve_sure_string (svr->id), ve_sure_string (section)) == 0) {
-
- if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_NAME)) == 0)
- string_old = svr->name;
- else if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_COMMAND)) == 0)
- string_old = svr->command;
-
- /* Update this servers configuration */
- if (strcmp (ve_sure_string (string_old),
- ve_sure_string (text)) != 0) {
- if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_NAME)) == 0) {
- if (svr->name)
- g_free (svr->name);
- svr->name = g_strdup (text);
- } else if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_COMMAND)) == 0) {
- if (svr->command)
- g_free (svr->command);
- svr->command = g_strdup (text);;
- }
- update_xserver (section, svr);
- }
- break;
- }
- }
- g_free (section);
-
- return FALSE;
-}
-
-static gboolean
-xserver_priority_timeout (GtkWidget *entry)
-{
- GtkWidget *mod_combobox;
- GSList *li;
- const char *key = g_object_get_data (G_OBJECT (entry), "key");
- gint value = 0;
- gchar *section;
-
- mod_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
-
- /* Get xserver section to update */
- section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (mod_combobox));
-
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
- if (strcmp (ve_sure_string (svr->id), ve_sure_string (section)) == 0) {
- gint new_value;
-
- if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_PRIORITY)) == 0)
- value = svr->priority;
-
- /* Update this servers configuration */
- new_value = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (entry));
- if (new_value != value) {
- svr->priority = new_value;
- update_xserver (section, svr);
- }
- break;
- }
- }
- g_free (section);
-
- return FALSE;
-}
-
-static gboolean
-xserver_toggle_timeout (GtkWidget *toggle)
-{
- GtkWidget *mod_combobox;
- const char *key = g_object_get_data (G_OBJECT (toggle), "key");
- GSList *li;
- gboolean val = FALSE;
- gchar *section;
-
- mod_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
-
- /* Get xserver section to update */
- section = gtk_combo_box_get_active_text (GTK_COMBO_BOX (mod_combobox));
-
- /* Locate this server's section */
- for (li = xservers; li != NULL; li = li->next) {
- GdmXserver *svr = li->data;
- if (strcmp (ve_sure_string (svr->id), ve_sure_string (section)) == 0) {
-
- if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_HANDLED)) == 0) {
- val = svr->handled;
- } else if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_FLEXIBLE)) == 0) {
- val = svr->flexible;
- }
-
- /* Update this servers configuration */
- if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
- gboolean new_val = GTK_TOGGLE_BUTTON (toggle)->active;
-
- if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_HANDLED)) == 0)
- svr->handled = new_val;
- else if (strcmp (ve_sure_string (key),
- ve_sure_string (GDM_KEY_SERVER_FLEXIBLE)) == 0)
- svr->flexible = new_val;
-
- update_xserver (section, svr);
- }
- break;
- }
- }
- g_free (section);
-
- return FALSE;
-}
-
-static void
-xserver_toggle_toggled (GtkWidget *toggle)
-{
- run_timeout (toggle, 500, xserver_toggle_timeout);
-}
-
-static void
-xserver_entry_changed (GtkWidget *entry)
-{
- run_timeout (entry, 500, xserver_entry_timeout);
-}
-
-static void
-xserver_priority_changed (GtkWidget *entry)
-{
- run_timeout (entry, 500, xserver_priority_timeout);
-}
-
-static void
-xserver_append_combobox (GdmXserver *xserver, GtkComboBox *combobox)
-{
- gtk_combo_box_append_text (combobox, (xserver->id));
-}
-
-static void
-xserver_populate_combobox (GtkComboBox* combobox)
-{
- gint i,j;
-
- /* Get number of items in combobox */
- i = gtk_tree_model_iter_n_children(
- gtk_combo_box_get_model (GTK_COMBO_BOX (combobox)), NULL);
-
- /* Delete all items from combobox */
- for (j = 0; j < i; j++) {
- gtk_combo_box_remove_text(combobox,0);
- }
-
- /* Populate combobox with list of current servers */
- g_slist_foreach (xservers, (GFunc) xserver_append_combobox, combobox);
-}
-
-static void
-xserver_init_server_list ()
-{
- /* Get Widgets from glade */
- GtkWidget *treeview = glade_helper_get (xml_xservers, "xserver_tree_view",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *remove_button = glade_helper_get (xml_xservers, "xserver_remove_button",
- GTK_TYPE_BUTTON);
-
- /* create list store */
- GtkListStore *store = gtk_list_store_new (XSERVER_NUM_COLUMNS,
- G_TYPE_INT /* virtual terminal */,
- G_TYPE_STRING /* server type */,
- G_TYPE_STRING /* options */);
-
- /* Read all xservers to start from configuration */
- xservers_get_displays (store);
- gtk_tree_view_set_model (GTK_TREE_VIEW (treeview),
- GTK_TREE_MODEL (store));
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (treeview), TRUE);
- gtk_widget_set_sensitive (remove_button, FALSE);
-}
-
-static void
-xserver_init_servers ()
-{
- GtkWidget *remove_button;
-
- /* Init widget states */
- xserver_init_server_list();
-
- remove_button = glade_helper_get (xml_xservers, "xserver_remove_button",
- GTK_TYPE_BUTTON);
- gtk_widget_set_sensitive (remove_button, FALSE);
-}
-
-static void
-xserver_row_selected(GtkTreeSelection *selection, gpointer data)
-{
- GtkWidget *remove_button;
-
- remove_button = glade_helper_get (xml_xservers, "xserver_remove_button",
- GTK_TYPE_BUTTON);
- gtk_widget_set_sensitive (remove_button, TRUE);
-}
-
-/*
- * Remove a server from the list of servers to start (not the same as
- * deleting a server definition)
- */
-static void
-xserver_remove_display (gpointer data)
-{
- GtkWidget *treeview, *combo;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreeModel *model;
- gint vt;
- char vt_value[3];
-
- treeview = glade_helper_get (xml_xservers, "xserver_tree_view",
- GTK_TYPE_TREE_VIEW);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
-
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- {
- VeConfig *cfg = ve_config_get (config_file);
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- gchar *defaultval;
- gchar *key;
-
- combo = glade_helper_get (xml_add_xservers, "xserver_server_combobox",
- GTK_TYPE_COMBO_BOX);
-
- /* Update config */
- gtk_tree_model_get (model, &iter, XSERVER_COLUMN_VT, &vt, -1);
-
- g_snprintf (vt_value, sizeof (vt_value), "%d", vt);
- key = g_strconcat (GDM_KEY_SECTION_SERVERS, "/", vt_value, "=", NULL);
-
- defaultval = ve_config_get_string (cfg, key);
-
- /*
- * If the value is in the default config file, set it to inactive in
- * the custom config file, else delete it
- */
- if (! ve_string_empty (defaultval)) {
- ve_config_set_string (custom_cfg, key, "inactive");
- } else {
- ve_config_delete_key (custom_cfg, key);
- }
- g_free (defaultval);
-
- ve_config_save (custom_cfg, FALSE /* force */);
-
- /* Update gdmsetup */
- xserver_init_server_list ();
- xserver_update_delete_sensitivity ();
- }
-}
-
-/* Add a display to the list of displays to start */
-static void
-xserver_add_display (gpointer data)
-{
- VeConfig *cfg = ve_config_get (config_file);
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- GtkWidget *spinner, *combo, *entry, *button;
- gchar *string;
- gchar *defaultval;
- char spinner_value[3], *key;
-
- /* Get Widgets from glade */
- spinner = glade_helper_get (xml_add_xservers, "xserver_spin_button",
- GTK_TYPE_SPIN_BUTTON);
- entry = glade_helper_get (xml_add_xservers, "xserver_options_entry",
- GTK_TYPE_ENTRY);
- combo = glade_helper_get (xml_add_xservers, "xserver_server_combobox",
- GTK_TYPE_COMBO_BOX);
- button = glade_helper_get (xml_xservers, "xserver_add_button",
- GTK_TYPE_BUTTON);
-
- /* String to add to config */
- g_snprintf (spinner_value, sizeof (spinner_value), "%d",
- gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spinner)));
-
- key = g_strconcat (GDM_KEY_SECTION_SERVERS, "/", spinner_value, "=", NULL);
- if (! ve_string_empty (gtk_entry_get_text (GTK_ENTRY (entry)))) {
- string = g_strconcat (gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)),
- " ", gtk_entry_get_text (GTK_ENTRY (entry)),
- NULL);
- } else {
- string = g_strdup (gtk_combo_box_get_active_text (GTK_COMBO_BOX (combo)));
- }
-
- defaultval = ve_config_get_string (cfg, key);
-
- /* Add to config */
- if (strcmp (ve_sure_string (defaultval), ve_sure_string (string)) == 0)
- ve_config_delete_key (custom_cfg, key);
- else
- ve_config_set_string (custom_cfg, key, ve_sure_string(string));
-
- ve_config_save (custom_cfg, FALSE /* force */);
- /* Reinitialize gdmsetup */
- xserver_init_servers ();
- xserver_update_delete_sensitivity ();
-
- /* Free memory */
- g_free (defaultval);
- g_free (string);
- g_free (key);
-}
-
-static void
-xserver_add_button_clicked (void)
-{
- static GtkWidget *dialog = NULL;
- GtkWidget *options_entry;
- GtkWidget *server_combobox;
- GtkWidget *vt_spinbutton;
- GtkWidget *parent;
- GtkWidget *treeview;
- GtkTreeSelection *selection;
- GtkTreeModel *treeview_model;
- GtkTreeIter treeview_iter;
- guint activate_signal_id;
- gboolean res;
-
- if (dialog == NULL) {
- parent = glade_helper_get (xml_xservers, "xserver_dialog", GTK_TYPE_WINDOW);
- dialog = glade_helper_get (xml_add_xservers, "add_xserver_dialog", GTK_TYPE_DIALOG);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
- }
-
- vt_spinbutton = glade_helper_get (xml_add_xservers, "xserver_spin_button",
- GTK_TYPE_SPIN_BUTTON);
- server_combobox = glade_helper_get (xml_add_xservers, "xserver_server_combobox",
- GTK_TYPE_COMBO_BOX);
- options_entry = glade_helper_get (xml_add_xservers, "xserver_options_entry",
- GTK_TYPE_ENTRY);
-
- activate_signal_id = g_signal_connect (G_OBJECT (vt_spinbutton), "activate",
- G_CALLBACK (vt_spinbutton_activate),
- (gpointer) dialog);
-
- xserver_populate_combobox (GTK_COMBO_BOX (server_combobox));
-
- gtk_widget_grab_focus (vt_spinbutton);
-
- treeview = glade_helper_get (xml_xservers, "xserver_tree_view",
- GTK_TYPE_TREE_VIEW);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
-
- /* set default values */
- if (gtk_tree_selection_get_selected (selection, &treeview_model, &treeview_iter)) {
-
- GtkTreeModel *combobox_model;
- GtkTreeIter combobox_iter;
- gchar *label;
- gchar *server;
- gint vt;
-
- gtk_tree_model_get (treeview_model, &treeview_iter, XSERVER_COLUMN_VT, &vt, -1);
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (vt_spinbutton), vt);
-
- gtk_tree_model_get (GTK_TREE_MODEL (treeview_model), &treeview_iter,
- XSERVER_COLUMN_SERVER, &server, -1);
- combobox_model = gtk_combo_box_get_model (GTK_COMBO_BOX (server_combobox));
-
- for (res = gtk_tree_model_get_iter_first (combobox_model, &combobox_iter); res; res = gtk_tree_model_iter_next (combobox_model, &combobox_iter)) {
- gtk_tree_model_get (combobox_model, &combobox_iter, 0, &label, -1);
- if (strcmp (ve_sure_string (label), ve_sure_string (server)) == 0) {
- gtk_combo_box_set_active_iter (GTK_COMBO_BOX (server_combobox), &combobox_iter);
- }
- g_free (label);
- }
-
- gtk_tree_model_get (GTK_TREE_MODEL (treeview_model), &treeview_iter,
- XSERVER_COLUMN_OPTIONS, &server, -1);
- if (server != NULL)
- gtk_entry_set_text (GTK_ENTRY (options_entry), server);
- } else {
- gint high_value = 0;
- gint vt;
-
- for (res = gtk_tree_model_get_iter_first (treeview_model, &treeview_iter); res; res = gtk_tree_model_iter_next (treeview_model, &treeview_iter)) {
- gtk_tree_model_get (treeview_model, &treeview_iter, XSERVER_COLUMN_VT, &vt, -1);
- if (high_value < vt) {
- high_value = vt;
- }
- }
-
- gtk_spin_button_set_value (GTK_SPIN_BUTTON (vt_spinbutton), ++high_value);
- gtk_combo_box_set_active (GTK_COMBO_BOX (server_combobox), 0);
- gtk_entry_set_text (GTK_ENTRY (options_entry), "");
- }
-
- if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
- xserver_add_display (NULL);
- }
- g_signal_handler_disconnect (vt_spinbutton, activate_signal_id);
- gtk_widget_hide (dialog);
-}
-
-/*
- * TODO: This section needs a little work until it is ready (mainly config
- * section modifications)
- * Create a server definition (not the same as removing a server
- * from the list of servers to start)
- */
-#ifdef GDM_TODO_CODE
-static void
-xserver_create (gpointer data)
-{
- /* VeConfig *cfg; */
- gboolean success;
-
- /* Init Widgets */
- GtkWidget *frame, *modify_combobox;
- GtkWidget *name_entry, *command_entry;
- GtkWidget *handled_check, *flexible_check;
- GtkWidget *greeter_radio, *chooser_radio;
- GtkWidget *create_button, *delete_button;
- GtkWidget *priority_spinbutton;
-
- /* Get Widgets from glade */
- frame = glade_helper_get (xml, "xserver_modify_frame",
- GTK_TYPE_FRAME);
- name_entry = glade_helper_get (xml, "xserver_name_entry",
- GTK_TYPE_ENTRY);
- command_entry = glade_helper_get (xml, "xserver_command_entry",
- GTK_TYPE_ENTRY);
- priority_spinbutton = glade_helper_get(xml, "xserv_priority_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
- handled_check = glade_helper_get (xml, "xserver_handled_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- flexible_check = glade_helper_get (xml, "xserver_flexible_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- greeter_radio = glade_helper_get (xml, "xserver_greeter_radiobutton",
- GTK_TYPE_RADIO_BUTTON);
- chooser_radio = glade_helper_get (xml, "xserver_chooser_radiobutton",
- GTK_TYPE_RADIO_BUTTON);
- modify_combobox = glade_helper_get (xml, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- create_button = glade_helper_get (xml, "xserver_create_button",
- GTK_TYPE_BUTTON);
- delete_button = glade_helper_get (xml, "xserver_delete_button",
- GTK_TYPE_BUTTON);
-
- gtk_combo_box_append_text (GTK_COMBO_BOX (modify_combobox),
- "New Server");
-
- /* TODO: Create a new section for this server */
- /* TODO: Write this value to the config and update xservers list */
- /* cfg = ve_config_get (custom_config_file); */
- success = FALSE;
- /* success = ve_config_add_section (cfg, SECTION_NAME); */
-
- if (success)
- {
- gint i;
-
- /* Update settings for new server */
- gtk_widget_set_sensitive (frame, TRUE);
- gtk_widget_set_sensitive (delete_button, TRUE);
- gtk_widget_grab_focus (name_entry);
- gtk_entry_set_text (GTK_ENTRY (name_entry), "New Server");
- gtk_editable_select_region (GTK_EDITABLE (name_entry), 0, -1);
- gtk_entry_set_text (GTK_ENTRY (command_entry), X_SERVER);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (greeter_radio),
- TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (chooser_radio),
- FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (handled_check),
- TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flexible_check),
- FALSE);
-
- /* Select the new server in the combobox */
- i = gtk_tree_model_iter_n_children (
- gtk_combo_box_get_model (GTK_COMBO_BOX (modify_combobox)), NULL) - 1;
- gtk_combo_box_set_active (GTK_COMBO_BOX (modify_combobox), i);
- }
-}
-#endif
-
-static void
-xserver_init_definitions ()
-{
- GtkWidget *style_combobox;
- GtkWidget *modify_combobox;
-
- style_combobox = glade_helper_get (xml_xservers, "xserver_style_combobox",
- GTK_TYPE_COMBO_BOX);
- modify_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
-
- xserver_populate_combobox (GTK_COMBO_BOX (modify_combobox));
-
- gtk_combo_box_set_active (GTK_COMBO_BOX (style_combobox), 0);
- init_servers_combobox (gtk_combo_box_get_active (GTK_COMBO_BOX (style_combobox)));
-}
-
-/*
- * Deletes a server definition (not the same as removing a server
- * from the list of servers to start)
- *
- * NOTE, now that we have the %{datadir}/gdm/defaults.conf and
- * %{etc}/gdm/custom.conf files, this will need to work like the displays.
- * So if you want to delete something that is defaults.conf you will need
- * to write a new value to custom.conf section for this xserver like
- * "inactive=true". For this to work, daemon/gdmconfig.c will also need
- * to be modified so that it doesn't bother loading xservers that are
- * marked as inactive in the custom.conf file. As I said, this
- * is the same way the displays already work so the code should be
- * similar. Or perhaps it makes more sense to just not allow
- * deleting of server-foo sections as defined in the defaults.conf
- * file. If the user doesn't want to use them, they can always
- * create new server-foo sections in custom.conf and define their
- * displays to only use the ones they define.
- */
-#ifdef GDM_UNUSED_CODE
-static void
-xserver_delete (gpointer data)
-{
- gchar temp_string;
-
- /* Get xserver section to delete */
- GtkWidget *combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- gchar *section = gtk_combo_box_get_active_text ( GTK_COMBO_BOX (combobox));
-
- /* Delete xserver section */
- VeConfig *custom_cfg = ve_config_get (custom_config_file);
- temp_string = g_strconcat (GDM_KEY_SERVER_PREFIX, section, NULL);
- ve_config_delete_section (custom_cfg, temp_string);
- g_free (temp_string);
-
- /* Reinitialize definitions */
- xserver_init_definitions();
-}
-#endif
-
-static void
-setup_xserver_support (GladeXML *xml_xservers)
-{
- GtkWidget *command_entry;
- GtkWidget *priority_spinbutton;
- GtkWidget *name_entry;
- GtkWidget *handled_check;
- GtkWidget *flexible_check;
- GtkWidget *create_button;
- GtkWidget *delete_button;
- GtkWidget *remove_button;
- GtkWidget *servers_combobox;
- GtkWidget *style_combobox;
- GtkWidget *treeview;
- GtkCellRenderer *renderer;
- GtkTreeSelection *selection;
- GtkTreeViewColumn *column;
-
- /* Initialize the xserver settings */
- xserver_init_definitions();
- xserver_init_servers();
-
- /* TODO: In the future, resolution/refresh rate configuration */
- /* setup_xrandr_support (); */
-
- /* Get Widgets from glade */
- treeview = glade_helper_get (xml_xservers, "xserver_tree_view",
- GTK_TYPE_TREE_VIEW);
- name_entry = glade_helper_get (xml_xservers, "xserver_name_entry",
- GTK_TYPE_ENTRY);
- command_entry = glade_helper_get (xml_xservers, "xserver_command_entry",
- GTK_TYPE_ENTRY);
- priority_spinbutton = glade_helper_get(xml_xservers, "xserv_priority_spinbutton",
- GTK_TYPE_SPIN_BUTTON);
- handled_check = glade_helper_get (xml_xservers, "xserver_handled_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- flexible_check = glade_helper_get (xml_xservers, "xserver_flexible_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- style_combobox = glade_helper_get (xml_xservers, "xserver_style_combobox",
- GTK_TYPE_COMBO_BOX);
- servers_combobox = glade_helper_get (xml_xservers, "xserver_mod_combobox",
- GTK_TYPE_COMBO_BOX);
- create_button = glade_helper_get (xml_xservers, "xserver_createbutton",
- GTK_TYPE_BUTTON);
- delete_button = glade_helper_get (xml_xservers, "xserver_deletebutton",
- GTK_TYPE_BUTTON);
- remove_button = glade_helper_get (xml_xservers, "xserver_remove_button",
- GTK_TYPE_BUTTON);
-
- glade_helper_tagify_label (xml_xservers, "xserver_informationlabel", "i");
- glade_helper_tagify_label (xml_xservers, "xserver_informationlabel", "small");
- glade_helper_tagify_label (xml_xservers, "server_to_start_label", "b");
- glade_helper_tagify_label (xml_xservers, "server_settings_label", "b");
-
- /* Setup Virtual terminal column in servers to start frame */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
- gtk_tree_view_column_set_title (column, "VT");
- gtk_tree_view_column_set_attributes (column, renderer,
- "text", XSERVER_COLUMN_VT,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
-
- /* Setup Server column in servers to start frame */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
- gtk_tree_view_column_set_title (column, "Server");
- gtk_tree_view_column_set_attributes (column, renderer,
- "text", XSERVER_COLUMN_SERVER,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
-
- /* Setup Options column in servers to start frame*/
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, TRUE);
- gtk_tree_view_column_set_title (column, "Options");
- gtk_tree_view_column_set_attributes (column, renderer,
- "text", XSERVER_COLUMN_OPTIONS,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (treeview), column);
-
- /* Setup tree selections */
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
-
- /* Register these items with keys */
- g_object_set_data_full (G_OBJECT (servers_combobox), "key",
- g_strdup (GDM_KEY_SERVER_PREFIX),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (name_entry), "key",
- g_strdup (GDM_KEY_SERVER_NAME),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (command_entry), "key",
- g_strdup (GDM_KEY_SERVER_COMMAND),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (handled_check), "key",
- g_strdup (GDM_KEY_SERVER_HANDLED),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (flexible_check), "key",
- g_strdup (GDM_KEY_SERVER_FLEXIBLE),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (style_combobox), "key",
- g_strdup (GDM_KEY_SERVER_CHOOSER),
- (GDestroyNotify) g_free);
- g_object_set_data_full (G_OBJECT (priority_spinbutton), "key",
- g_strdup (GDM_KEY_SERVER_PRIORITY),
- (GDestroyNotify) g_free);
- /* Signals Handlers */
- g_signal_connect (G_OBJECT (name_entry), "changed",
- G_CALLBACK (xserver_entry_changed),NULL);
- g_signal_connect (G_OBJECT (command_entry), "changed",
- G_CALLBACK (xserver_entry_changed), NULL);
- g_signal_connect (G_OBJECT (handled_check), "toggled",
- G_CALLBACK (xserver_toggle_toggled), NULL);
- g_signal_connect (G_OBJECT (flexible_check), "toggled",
- G_CALLBACK (xserver_toggle_toggled), NULL);
- g_signal_connect (G_OBJECT (servers_combobox), "changed",
- G_CALLBACK (combobox_changed), NULL);
- g_signal_connect (G_OBJECT (style_combobox), "changed",
- G_CALLBACK (combobox_changed), NULL);
- g_signal_connect (G_OBJECT (remove_button), "clicked",
- G_CALLBACK (xserver_remove_display), NULL);
- g_signal_connect (G_OBJECT (selection), "changed",
- G_CALLBACK (xserver_row_selected), NULL);
- g_signal_connect (G_OBJECT (priority_spinbutton), "value_changed",
- G_CALLBACK (xserver_priority_changed), NULL);
-
- /* TODO: In the future, allow creation & delection of servers
- g_signal_connect (create_button, "clicked",
- G_CALLBACK (xserver_create), NULL);
- g_signal_connect (delete_button, "clicked",
- G_CALLBACK (xserver_delete), NULL);
- */
-}
-
-static void
-xserver_button_clicked (void)
-{
- static GtkWidget *dialog = NULL;
- int response;
-
- if (dialog == NULL) {
-
- GtkWidget *parent;
- GtkWidget *button;
-
- xml_xservers = glade_helper_load ("gdmsetup.glade",
- "xserver_dialog",
- GTK_TYPE_DIALOG,
- TRUE);
-
- xml_add_xservers = glade_helper_load ("gdmsetup.glade",
- "add_xserver_dialog",
- GTK_TYPE_DIALOG,
- TRUE);
-
- parent = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- dialog = glade_helper_get (xml_xservers, "xserver_dialog", GTK_TYPE_DIALOG);
- button = glade_helper_get (xml_xservers, "xserver_add_button", GTK_TYPE_BUTTON);
-
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
- gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
-
- g_signal_connect (G_OBJECT (button), "clicked",
- G_CALLBACK (xserver_add_button_clicked), NULL);
-
- setup_xserver_support (xml_xservers);
- }
-
- do {
- response = gtk_dialog_run (GTK_DIALOG (dialog));
- if (response == GTK_RESPONSE_HELP) {
- g_spawn_command_line_sync ("gnome-open ghelp:gdm", NULL, NULL,
- NULL, NULL);
- }
- } while (response != GTK_RESPONSE_CLOSE &&
- response != GTK_RESPONSE_DELETE_EVENT);
-
- gtk_widget_hide (dialog);
-}
-
-static void
-setup_radio_group (const gchar *name,
- const gchar *key, gint position)
-{
- GtkWidget *radio;
- gint val;
-
- radio = glade_helper_get (xml, name, GTK_TYPE_RADIO_BUTTON);
- val = gdm_config_get_int ((gchar *)key);
-
- if (val == position)
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
- else
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), FALSE);
-
- g_object_set_data_full (G_OBJECT (radio), "key", g_strdup (key),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (radio), "toggled",
- G_CALLBACK (radiogroup_toggled), NULL);
-}
-
-static void
-setup_security_tab (void)
-{
- GtkWidget *checkbox;
- GtkWidget *label;
- GtkWidget *XDMCPbutton;
-
- /* Setup Local administrator login setttings */
- setup_notify_toggle ("allowroot", GDM_KEY_ALLOW_ROOT);
-
- /* Setup Remote administrator login setttings */
- setup_notify_toggle ("allowremoteroot", GDM_KEY_ALLOW_REMOTE_ROOT);
-
- /* Setup Enable debug message to system log */
- setup_notify_toggle ("enable_debug", GDM_KEY_DEBUG);
-
- /* Setup Deny TCP connections to Xserver */
- setup_notify_toggle ("disallow_tcp", GDM_KEY_DISALLOW_TCP);
-
- /* Setup never place cookies on NFS */
- setup_notify_toggle ("never_cookies_NFS_checkbutton", GDM_KEY_NEVER_PLACE_COOKIES_ON_NFS);
-
- /* Setup Retry delay */
- setup_intspin ("retry_delay", GDM_KEY_RETRY_DELAY);
-
- /* Bold the Enable automatic login label */
- checkbox = glade_helper_get (xml, "autologin",
- GTK_TYPE_CHECK_BUTTON);
- label = gtk_bin_get_child (GTK_BIN (checkbox));
- g_object_set (G_OBJECT (label), "use_markup", TRUE, NULL);
-
- /* Bold the Enable timed login label */
- checkbox = glade_helper_get (xml, "timedlogin",
- GTK_TYPE_CHECK_BUTTON);
- label = gtk_bin_get_child (GTK_BIN (checkbox));
- g_object_set (G_OBJECT (label), "use_markup", TRUE, NULL);
-
- /* Setup Enable automatic login */
- setup_user_combobox ("autologin_combo",
- GDM_KEY_AUTOMATIC_LOGIN);
- setup_notify_toggle ("autologin", GDM_KEY_AUTOMATIC_LOGIN_ENABLE);
-
- /* Setup Enable timed login */
- setup_user_combobox ("timedlogin_combo",
- GDM_KEY_TIMED_LOGIN);
- setup_intspin ("timedlogin_seconds", GDM_KEY_TIMED_LOGIN_DELAY);
- setup_notify_toggle ("timedlogin", GDM_KEY_TIMED_LOGIN_ENABLE);
-
- /* Setup Allow remote timed logins */
- setup_notify_toggle ("allowremoteauto", GDM_KEY_ALLOW_REMOTE_AUTOLOGIN);
-
- /* Setup check dir owner */
- setup_notify_toggle ("check_dir_owner_checkbutton", GDM_KEY_CHECK_DIR_OWNER);
-
- /* Setup Relax permissions */
- setup_radio_group ("relax_permissions0_radiobutton", GDM_KEY_RELAX_PERM, 0);
- setup_radio_group ("relax_permissions1_radiobutton", GDM_KEY_RELAX_PERM, 1);
- setup_radio_group ("relax_permissions2_radiobutton", GDM_KEY_RELAX_PERM, 2);
-
- /* Setup MinimalUID */
- setup_intspin ("minimal_uid_spinbutton", GDM_KEY_MINIMAL_UID);
-
- /* Setup Configure XDMCP button */
- XDMCPbutton = glade_helper_get (xml, "config_xserverbutton",
- GTK_TYPE_BUTTON);
- setup_xdmcp_support ();
- g_signal_connect (G_OBJECT (XDMCPbutton), "clicked",
- G_CALLBACK (xserver_button_clicked), NULL);
-}
-
-static GList *
-get_file_list_from_uri_list (gchar *uri_list)
-{
- GList *list = NULL;
- gchar **uris = NULL;
- gint index;
-
- if (uri_list == NULL) {
- return NULL;
- }
-
- uris = g_uri_list_extract_uris (uri_list);
-
- for (index = 0; uris[index] != NULL; index++) {
-
- gchar *filename;
-
- if (g_path_is_absolute (uris[index]) == TRUE) {
- filename = g_strdup (uris[index]);
- }
- else {
- gchar *host = NULL;
-
- filename = g_filename_from_uri (uris[index], &host, NULL);
-
- /* Sorry, we can only accept local files. */
- if (host != NULL) {
- g_free (filename);
- g_free (host);
- filename = NULL;
- }
- }
-
- if (filename != NULL) {
- list = g_list_prepend (list, filename);
- }
- }
- g_strfreev (uris);
- return g_list_reverse (list);
-}
-
-static void
-theme_list_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer extra_data)
-{
- GtkWidget *parent;
- GtkWidget *theme_list;
- GtkListStore *store;
- GList *list;
-
- parent = glade_helper_get (xml, "setup_dialog", GTK_TYPE_WINDOW);
- theme_list = glade_helper_get (xml, "gg_theme_list", GTK_TYPE_TREE_VIEW);
- store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list)));
-
- gtk_drag_finish (context, TRUE, FALSE, time);
-
- for (list = get_file_list_from_uri_list ((gchar *)data->data); list != NULL; list = list-> next) {
-
- GtkWidget *prompt;
- gchar *base;
- gchar *mesg;
- gchar *detail;
- gint response;
-
- base = g_path_get_basename ((gchar *)list->data);
- mesg = g_strdup_printf (_("Install the theme from '%s'?"), base);
- detail = g_strdup_printf (_("Select install to add the theme from the file '%s'."), (gchar *)list->data);
-
- prompt = ve_hig_dialog_new (GTK_WINDOW (parent),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- mesg,
- detail);
-
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-cancel", GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (prompt), _("_Install"), GTK_RESPONSE_OK);
-
- response = gtk_dialog_run (GTK_DIALOG (prompt));
- gtk_widget_destroy (prompt);
- g_free (mesg);
-
- if (response == GTK_RESPONSE_OK) {
- install_theme_file (list->data, store, GTK_WINDOW (parent));
- }
- }
-}
-
-static gboolean
-theme_list_equal_func (GtkTreeModel * model,
- gint column,
- const gchar * key,
- GtkTreeIter * iter,
- gpointer search_data)
-{
- gboolean results = TRUE;
- gchar *name;
-
- gtk_tree_model_get (model, iter, THEME_COLUMN_MARKUP, &name, -1);
-
- if (name != NULL) {
- gchar * casefold_key;
- gchar * casefold_name;
-
- casefold_key = g_utf8_casefold (key, -1);
- casefold_name = g_utf8_casefold (name, -1);
-
- if ((casefold_key != NULL) &&
- (casefold_name != NULL) &&
- (strstr (casefold_name, casefold_key) != NULL)) {
- results = FALSE;
- }
- g_free (casefold_key);
- g_free (casefold_name);
- g_free (name);
- }
- return results;
-}
-
-
-static void
-setup_local_themed_settings (void)
-{
- gboolean GdmGraphicalThemeRand;
- DIR *dir;
- GtkListStore *store;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
- GtkTreeIter *select_iter = NULL;
- GtkWidget *color_colorbutton;
- GtkWidget *style_label;
- GtkWidget *theme_label;
- GtkSizeGroup *size_group;
- char *theme_dir;
-
- GtkWidget *theme_list = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *button = glade_helper_get (xml, "gg_install_new_theme",
- GTK_TYPE_BUTTON);
- GtkWidget *del_button = glade_helper_get (xml, "gg_delete_theme",
- GTK_TYPE_BUTTON);
- GtkWidget *mode_combobox = glade_helper_get (xml, "gg_mode_combobox",
- GTK_TYPE_COMBO_BOX);
-
- style_label = glade_helper_get (xml, "local_stylelabel", GTK_TYPE_LABEL);
- theme_label = glade_helper_get (xml, "local_theme_label", GTK_TYPE_LABEL);
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (size_group, style_label);
- gtk_size_group_add_widget (size_group, theme_label);
-
- color_colorbutton = glade_helper_get (xml,
- "local_background_theme_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
-
- g_object_set_data (G_OBJECT (color_colorbutton), "key",
- GDM_KEY_GRAPHICAL_THEMED_COLOR);
-
- setup_greeter_color ("local_background_theme_colorbutton",
- GDM_KEY_GRAPHICAL_THEMED_COLOR);
-
- theme_dir = get_theme_dir ();
-
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (theme_list), TRUE);
-
- selected_theme = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME);
- selected_themes = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMES);
-
- /* FIXME: If a theme directory contains the string GDM_DELIMITER_THEMES
- in the name, then this theme won't work when trying to load as it
- will be perceived as two different themes seperated by
- GDM_DELIMITER_THEMES. This can be fixed by setting up an escape
- character for it, but I'm not sure if directories can have the
- slash (/) character in them, so I just made GDM_DELIMITER_THEMES
- equal to "/:" instead. */
-
- GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
-
- /* create list store */
- store = gtk_list_store_new (THEME_NUM_COLUMNS,
- G_TYPE_BOOLEAN /* selected theme */,
- G_TYPE_BOOLEAN /* selected themes */,
- G_TYPE_STRING /* dir */,
- G_TYPE_STRING /* file */,
- GDK_TYPE_PIXBUF /* preview */,
- G_TYPE_STRING /* markup */,
- G_TYPE_STRING /* name */,
- G_TYPE_STRING /* desc */,
- G_TYPE_STRING /* author */,
- G_TYPE_STRING /* copyright */);
-
- /* Register theme mode combobox */
- g_object_set_data_full (G_OBJECT (mode_combobox), "key",
- g_strdup (GDM_KEY_GRAPHICAL_THEME_RAND),
- (GDestroyNotify) g_free);
-
- /* Signals */
- g_signal_connect (mode_combobox, "changed",
- G_CALLBACK (combobox_changed), NULL);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (install_new_theme), store);
- g_signal_connect (del_button, "clicked",
- G_CALLBACK (delete_theme), store);
-
- /* Init controls */
- gtk_widget_set_sensitive (del_button, FALSE);
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode_combobox),
- GdmGraphicalThemeRand);
-
- /* Read all Themes from directory and store in tree */
- dir = opendir (theme_dir);
- if (dir != NULL) {
- select_iter = read_themes (store, theme_dir, dir,
- selected_theme);
- closedir (dir);
- }
- g_free (theme_dir);
- gtk_tree_view_set_model (GTK_TREE_VIEW (theme_list),
- GTK_TREE_MODEL (store));
-
- /* The radio toggle column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_toggle_new ();
- gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer),
- TRUE);
- g_signal_connect (G_OBJECT (renderer), "toggled",
- G_CALLBACK (selected_toggled), store);
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "active", THEME_COLUMN_SELECTED, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
- gtk_tree_view_column_set_visible(column, !GdmGraphicalThemeRand);
-
- /* The checkbox toggle column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_toggle_new ();
- gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer),
- FALSE);
- g_signal_connect (G_OBJECT (renderer), "toggled",
- G_CALLBACK (selected_toggled), store);
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer, "active",
- THEME_COLUMN_SELECTED_LIST, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
- gtk_tree_view_column_set_visible(column, GdmGraphicalThemeRand);
-
- /* The preview column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "pixbuf", THEME_COLUMN_SCREENSHOT,
- NULL);
- /* The markup column */
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "markup", THEME_COLUMN_MARKUP, NULL);
- gtk_tree_view_column_set_spacing (column, 6);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
-
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- THEME_COLUMN_MARKUP, GTK_SORT_ASCENDING);
-
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (theme_list),
- theme_list_equal_func, NULL, NULL);
-
- /* Selection setup */
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed",
- G_CALLBACK (gg_selection_changed), NULL);
-
- gtk_drag_dest_set (theme_list,
- GTK_DEST_DEFAULT_ALL,
- target_table, n_targets,
- GDK_ACTION_COPY);
-
- g_signal_connect (theme_list, "drag_data_received",
- G_CALLBACK (theme_list_drag_data_received), NULL);
-
- if (select_iter != NULL) {
- gtk_tree_selection_select_iter (selection, select_iter);
- g_free (select_iter);
- }
-}
-
-static gboolean
-delete_event (GtkWidget *w)
-{
- timeout_remove_all ();
- gtk_main_quit ();
- return FALSE;
-}
-
-static void
-dialog_response (GtkWidget *dlg, int response, gpointer data)
-{
- if (response == GTK_RESPONSE_CLOSE) {
- timeout_remove_all ();
- gtk_main_quit ();
- } else if (response == GTK_RESPONSE_HELP) {
- GtkWidget *setup_dialog = glade_helper_get
- (xml, "setup_dialog", GTK_TYPE_WINDOW);
- static GtkWidget *dlg = NULL;
-
- if (dlg != NULL) {
- gtk_window_present (GTK_WINDOW (dlg));
- return;
- }
-
- if ( ! RUNNING_UNDER_GDM) {
- gint exit_status;
- if (g_spawn_command_line_sync ("gnome-open ghelp:gdm", NULL, NULL,
- &exit_status, NULL) && exit_status == 0)
- return;
- }
-
- /* fallback help dialogue */
-
- /* HIG compliance? */
- dlg = gtk_message_dialog_new
- (GTK_WINDOW (setup_dialog),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- /* This is the temporary help dialog */
- _("This configuration window changes settings "
- "for the GDM daemon, which is the graphical "
- "login screen for GNOME. Changes that you make "
- "will take effect immediately.\n\n"
- "Note that not all configuration options "
- "are listed here. You may want to edit %s "
- "if you cannot find what you are looking for.\n\n"
- "For complete documentation see the GNOME help browser "
- "under the \"Desktop\" category."),
- custom_config_file);
- gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
- g_signal_connect (G_OBJECT (dlg), "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &dlg);
- g_signal_connect_swapped (G_OBJECT (dlg), "response",
- G_CALLBACK (gtk_widget_destroy),
- dlg);
- gtk_widget_show (dlg);
- }
-}
-
-static void
-background_filechooser_response (GtkWidget *file_chooser, gpointer data)
-{
- gchar *filename = NULL;
- gchar *key;
- gchar *value;
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
- key = g_object_get_data (G_OBJECT (file_chooser), "key");
- value = gdm_config_get_string (key);
-
- /*
- * File_name should never be NULL, but something about this GUI causes
- * this function to get called on startup and filename=NULL even
- * though we set the filename in hookup_*_background. Resetting the
- * value to the default in this case seems to work around this.
- */
- if (filename == NULL && !ve_string_empty (value))
- filename = g_strdup (value);
-
- if (filename != NULL &&
- (strcmp (ve_sure_string (value), ve_sure_string (filename)) != 0)) {
- gchar *old_filename;
- old_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
-
- if (strcmp (old_filename, filename) == 0)
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_chooser),
- filename);
- g_free (old_filename);
-
- if (strcmp (ve_sure_string (value), ve_sure_string (filename)) != 0) {
- gdm_setup_config_set_string (key, (char *)ve_sure_string (filename));
- update_greeters ();
- }
- }
- g_free (filename);
-}
-
-static void
-logo_filechooser_response (GtkWidget *file_chooser, gpointer data)
-{
- GtkWidget *image_toggle;
- gchar *filename;
- gchar *key;
- gchar *value;
-
- filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
- key = g_object_get_data (G_OBJECT (file_chooser), "key");
- value = gdm_config_get_string (key);
-
- /*
- * File_name should never be NULL, but something about this GUI causes
- * this function to get called on startup and filename=NULL even
- * though we set the filename in hookup_*_background. Resetting the
- * value to the default in this case seems to work around this.
- */
- if (filename == NULL && !ve_string_empty (value))
- filename = g_strdup (value);
-
- if (filename == NULL) {
- value = gdm_config_get_string (GDM_KEY_CHOOSER_BUTTON_LOGO);
- if (!ve_string_empty (value))
- filename = g_strdup (value);
- }
-
- if (gtk_notebook_get_current_page (GTK_NOTEBOOK (setup_notebook)) == LOCAL_TAB) {
- image_toggle = glade_helper_get (xml,
- "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- } else {
- image_toggle = glade_helper_get (xml,
- "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- }
-
- if (filename != NULL &&
- (strcmp (ve_sure_string (value), ve_sure_string (filename)) != 0)) {
- gchar *old_filename;
-
- old_filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (file_chooser));
-
- if (strcmp (old_filename, filename) != 0)
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (file_chooser),
- filename);
- g_free (old_filename);
-
- if (GTK_TOGGLE_BUTTON (image_toggle)->active == TRUE) {
- gdm_setup_config_set_string (key,
- (char *)ve_sure_string (filename));
- update_greeters ();
- }
- }
- g_free (filename);
-}
-
-static GdkPixbuf *
-create_preview_pixbuf (gchar *uri)
-{
- GdkPixbuf *pixbuf = NULL;
-
- if ((uri != NULL) && (uri[0] != '\0')) {
-
- gchar *file = NULL;
-
- if (g_path_is_absolute (uri) == TRUE) {
- file = g_strdup (uri);
- }
- else {
- /* URIs are local, because gtk_file_chooser_get_local_only() is true. */
- file = g_filename_from_uri (uri, NULL, NULL);
- }
-
- if (file != NULL) {
-
- GdkPixbufFormat *info = NULL;
- gint width;
- gint height;
-
- info = gdk_pixbuf_get_file_info (file, &width, &height);
-
- if (width > 128 || height > 128) {
- pixbuf = gdk_pixbuf_new_from_file_at_size (file, 128, 128, NULL);
- }
- else {
- pixbuf = gdk_pixbuf_new_from_file (file, NULL);
- }
- g_free (file);
- }
- }
- return pixbuf;
-}
-
-static void
-update_image_preview (GtkFileChooser *chooser)
-{
- GtkWidget *image;
- gchar *uri;
-
- image = gtk_file_chooser_get_preview_widget (GTK_FILE_CHOOSER (chooser));
- uri = gtk_file_chooser_get_preview_uri (chooser);
-
- if (uri != NULL) {
-
- GdkPixbuf *pixbuf = NULL;
-
- pixbuf = create_preview_pixbuf (uri);
-
- if (pixbuf != NULL) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
- g_object_unref (pixbuf);
- }
- else {
- gtk_image_set_from_stock (GTK_IMAGE (image),
- "gtk-dialog-question",
- GTK_ICON_SIZE_DIALOG);
- }
- }
- gtk_file_chooser_set_preview_widget_active (chooser, TRUE);
-}
-
-static void
-hookup_plain_background (void)
-{
- /* Initialize and hookup callbacks for plain background settings */
- GtkFileFilter *filter;
- GtkWidget *color_radiobutton;
- GtkWidget *color_colorbutton;
- GtkWidget *image_radiobutton;
- GtkWidget *image_filechooser;
- GtkWidget *image_scale_to_fit;
- GtkWidget *image_preview;
- gchar *background_filename;
-
- color_radiobutton = glade_helper_get (xml,
- "local_background_color_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- color_colorbutton = glade_helper_get (xml,
- "local_background_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
-
- image_radiobutton = glade_helper_get (xml,
- "local_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- image_filechooser = glade_helper_get (xml,
- "local_background_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- image_scale_to_fit = glade_helper_get (xml,
- "sg_scale_background",
- GTK_TYPE_CHECK_BUTTON);
-
- setup_greeter_color ("local_background_colorbutton",
- GDM_KEY_BACKGROUND_COLOR);
-
- setup_greeter_toggle ("sg_scale_background",
- GDM_KEY_BACKGROUND_SCALE_TO_FIT);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_scale_to_fit),
- gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT));
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (image_filechooser), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern(filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (image_filechooser), filter);
-
- background_filename = gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
-
- if (ve_string_empty (background_filename)) {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (image_filechooser),
- PIXMAPDIR);
- } else {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (image_filechooser),
- background_filename);
- }
-
- switch (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE)) {
-
- case BACKGROUND_IMAGE_AND_COLOR: {
- /* Image & Color background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), TRUE);
- gtk_widget_set_sensitive (image_scale_to_fit, TRUE);
- gtk_widget_set_sensitive (image_filechooser, TRUE);
- gtk_widget_set_sensitive (color_colorbutton, TRUE);
-
- break;
- }
- case BACKGROUND_COLOR: {
- /* Color background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), TRUE);
- gtk_widget_set_sensitive (image_scale_to_fit, FALSE);
- gtk_widget_set_sensitive (image_filechooser, FALSE);
- gtk_widget_set_sensitive (color_colorbutton, TRUE);
-
- break;
- }
- case BACKGROUND_IMAGE: {
- /* Image background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), FALSE);
- gtk_widget_set_sensitive (image_scale_to_fit, TRUE);
- gtk_widget_set_sensitive (image_filechooser, TRUE);
- gtk_widget_set_sensitive (color_colorbutton, FALSE);
-
- break;
- }
- default: {
- /* No background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), FALSE);
- gtk_widget_set_sensitive (color_colorbutton, FALSE);
- gtk_widget_set_sensitive (image_scale_to_fit, FALSE);
- gtk_widget_set_sensitive (image_filechooser, FALSE);
- }
- }
-
- gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (image_filechooser),
- FALSE);
- image_preview = gtk_image_new ();
- if (!ve_string_empty (background_filename)) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image_preview),
- create_preview_pixbuf (background_filename));
- }
- gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (image_filechooser),
- image_preview);
- gtk_widget_set_size_request (image_preview, 128, -1);
- gtk_widget_show (image_preview);
-
- g_object_set_data (G_OBJECT (color_radiobutton), "key",
- GDM_KEY_BACKGROUND_TYPE);
- g_object_set_data (G_OBJECT (color_colorbutton), "key",
- GDM_KEY_BACKGROUND_COLOR);
- g_object_set_data (G_OBJECT (image_radiobutton), "key",
- GDM_KEY_BACKGROUND_TYPE);
- g_object_set_data (G_OBJECT (image_filechooser), "key",
- GDM_KEY_BACKGROUND_IMAGE);
- g_object_set_data (G_OBJECT (image_scale_to_fit), "key",
- GDM_KEY_BACKGROUND_SCALE_TO_FIT);
-
- g_signal_connect (G_OBJECT (color_radiobutton), "toggled",
- G_CALLBACK (local_background_type_toggled), NULL);
- g_signal_connect (G_OBJECT (color_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), color_colorbutton);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (local_background_type_toggled), NULL);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), image_filechooser);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), image_scale_to_fit);
- g_signal_connect (G_OBJECT (image_filechooser), "selection-changed",
- G_CALLBACK (background_filechooser_response), image_filechooser);
- g_signal_connect (G_OBJECT (image_filechooser), "update-preview",
- G_CALLBACK (update_image_preview), NULL);
-}
-
-static void
-hookup_plain_behaviour (void)
-{
- /* Setup qiver */
- setup_notify_toggle ("local_quiver_checkbox", GDM_KEY_QUIVER);
-
- /* Setup show title bar */
- setup_notify_toggle ("local_title_bar_checkbutton", GDM_KEY_TITLE_BAR);
-
- /* Setup lock position */
- setup_notify_toggle ("local_lock_pos_checkbox", GDM_KEY_LOCK_POSITION);
-
- /* Setup set position */
- setup_notify_toggle ("local_set_pos_checkbox", GDM_KEY_SET_POSITION);
-
- /* Setup positionX */
- setup_intspin ("local_posx_spinbutton", GDM_KEY_POSITION_X);
-
- /* Setup positionX */
- setup_intspin ("local_posy_spinbutton", GDM_KEY_POSITION_Y);
-
-}
-
-static void
-hookup_plain_logo (void)
-{
- /* Initialize and hookup callbacks for plain logo settings */
- GtkFileFilter *filter;
- GtkWidget *logo_checkbutton;
- GtkWidget *logo_button;
- GtkWidget *image_preview;
- gchar *logo_filename;
-
- logo_checkbutton = glade_helper_get (xml,
- "local_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- logo_button = glade_helper_get (xml,
- "local_logo_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
-
- gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (logo_button),
- FALSE);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (logo_button), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern(filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (logo_button), filter);
-
- logo_filename = gdm_config_get_string (GDM_KEY_LOGO);
-
- if (ve_string_empty (logo_filename)) {
- logo_filename = gdm_config_get_string (GDM_KEY_CHOOSER_BUTTON_LOGO);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (logo_checkbutton),
- FALSE);
- gtk_widget_set_sensitive (logo_button, FALSE);
- }
- else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (logo_checkbutton),
- TRUE);
- gtk_widget_set_sensitive (logo_button, TRUE);
- }
-
- if (ve_string_empty (logo_filename)) {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (logo_button),
- PIXMAPDIR);
- } else {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (logo_button),
- logo_filename);
- }
-
- image_preview = gtk_image_new ();
- if (!ve_string_empty (logo_filename)) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image_preview),
- create_preview_pixbuf (logo_filename));
- }
- gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (logo_button),
- image_preview);
- gtk_widget_set_size_request (image_preview, 128, -1);
- gtk_widget_show (image_preview);
-
- g_object_set_data (G_OBJECT (logo_button), "key", GDM_KEY_LOGO);
- g_object_set_data (G_OBJECT (logo_checkbutton), "key", GDM_KEY_LOGO);
-
- g_signal_connect (G_OBJECT (logo_checkbutton), "toggled",
- G_CALLBACK (logo_toggle_toggled), NULL);
- g_signal_connect (G_OBJECT (logo_checkbutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), logo_button);
- g_signal_connect (G_OBJECT (logo_button), "selection-changed",
- G_CALLBACK (logo_filechooser_response), logo_button);
- g_signal_connect (G_OBJECT (logo_button), "update-preview",
- G_CALLBACK (update_image_preview), NULL);
-}
-
-static void
-setup_plain_menubar (void)
-{
- /* Initialize and hookup callbacks for plain menu bar settings */
- setup_notify_toggle ("sysmenu", GDM_KEY_SYSTEM_MENU);
- setup_notify_toggle ("config_available", GDM_KEY_CONFIG_AVAILABLE);
- setup_notify_toggle ("chooser_button", GDM_KEY_CHOOSER_BUTTON);
-}
-
-
-static void
-setup_local_welcome_message (void)
-{
- /* Initialize and hookup callbacks for local welcome message settings */
- setup_greeter_toggle ("sg_defaultwelcome", GDM_KEY_DEFAULT_WELCOME);
- setup_greeter_untranslate_entry ("welcome", GDM_KEY_WELCOME);
-}
-
-static void
-setup_remote_welcome_message (void)
-{
- /* Initialize and hookup callbacks for local welcome message settings */
- setup_greeter_toggle ("sg_defaultwelcomeremote", GDM_KEY_DEFAULT_REMOTE_WELCOME);
- setup_greeter_untranslate_entry ("welcomeremote", GDM_KEY_REMOTE_WELCOME);
-}
-
-static void
-setup_local_plain_settings (void)
-{
- /* Style setting */
- setup_greeter_combobox ("local_greeter",
- GDM_KEY_GREETER);
-
- /* Plain background settings */
- hookup_plain_background ();
-
- /* Plain behaviour settings */
- hookup_plain_behaviour ();
-
- /* Plain logo settings */
- hookup_plain_logo ();
-
- /* Plain menu bar settings */
- setup_plain_menubar ();
-
- /* Local welcome message settings */
- setup_local_welcome_message ();
-}
-
-static void
-setup_default_session (void)
-{
- GtkWidget *default_session_combobox;
- GtkWidget *default_session_checkbox;
- GHashTable *sessnames = NULL;
- GList *org_sessions = NULL;
- GList *tmp;
- gint i = 0;
- gint active = 0;
- gchar *org_val;
-
- _gdm_session_list_init (&sessnames, &org_sessions, NULL, NULL);
-
- default_session_combobox = glade_helper_get (xml, "default_session_combobox", GTK_TYPE_COMBO_BOX);
-
- org_val = gdm_config_get_string (GDM_KEY_DEFAULT_SESSION);
-
- for (tmp = org_sessions; tmp != NULL; tmp = tmp->next, i++) {
- GdmSession *session;
- gchar *file;
-
- file = (gchar *) tmp->data;
- if (strcmp (ve_sure_string (org_val), ve_sure_string (file)) == 0)
- active = i;
-
- session = g_hash_table_lookup (sessnames, file);
-
- if (!ve_string_empty (session->clearname)) {
- gtk_combo_box_append_text (GTK_COMBO_BOX (default_session_combobox),
- session->clearname);
- sessions = g_list_prepend (sessions, file);
- }
- /* This is a sort of safety fallback
- if session does not have the clearname defined
- we will use name instead*/
- else if (!ve_string_empty (session->name)) {
- gtk_combo_box_append_text (GTK_COMBO_BOX (default_session_combobox),
- session->name);
- sessions = g_list_prepend (sessions, file);
- }
-
- }
-
- sessions = g_list_reverse (sessions);
-
- /* some cleanup */
- g_list_free (org_sessions);
- g_hash_table_remove_all (sessnames);
-
- if (!ve_string_empty (org_val)) {
- gtk_widget_set_sensitive (default_session_combobox, TRUE);
- gtk_combo_box_set_active (GTK_COMBO_BOX (default_session_combobox), active);
- }
- else
- gtk_widget_set_sensitive (default_session_combobox, FALSE);
-
- g_object_set_data_full (G_OBJECT (default_session_combobox), "key",
- g_strdup (GDM_KEY_DEFAULT_SESSION),
- (GDestroyNotify) g_free);
-
- g_signal_connect (default_session_combobox, "changed",
- G_CALLBACK (combobox_changed), NULL);
-
- default_session_checkbox = glade_helper_get (xml,
- "default_session_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (default_session_checkbox), !ve_string_empty (org_val));
-
- g_object_set_data_full (G_OBJECT (default_session_checkbox),
- "key", g_strdup (GDM_KEY_DEFAULT_SESSION),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (default_session_checkbox), "toggled",
- G_CALLBACK (toggle_toggled), default_session_checkbox);
- g_signal_connect (G_OBJECT (default_session_checkbox), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), default_session_combobox);
-
- g_free (org_val);
-
-}
-
-static void
-setup_general_tab (void)
-{
- GtkWidget *gtkrc_filechooser;
- GtkWidget *gtkrc_checkbox;
- GtkWidget *clock_type_chooser;
- GtkWidget *commands_button;
- gchar *gtkrc_filename;
- gchar *user_24hr_clock;
-
-
- /* Setup use visual feedback in the passwotrd entry */
- setup_notify_toggle ("vis_feedback_passwd_checkbox", GDM_KEY_ENTRY_INVISIBLE);
-
- /* Setup use circles in the password entry */
- setup_notify_toggle ("use_circles_passwd_checkbox", GDM_KEY_ENTRY_CIRCLES);
-
- /* Setup always restart server */
- setup_notify_toggle ("a_restart_server_checkbutton", GDM_KEY_ALWAYS_RESTART_SERVER);
-
- /* Setup always login current session */
- setup_notify_toggle ("a_login_curr_session_checkbutton", GDM_KEY_ALWAYS_LOGIN_CURRENT_SESSION);
-
- /* Setup default session */
- setup_default_session ();
-
- /* Setup GtkRC file path */
- gtkrc_filechooser = glade_helper_get (xml,
- "gtkrc_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- gtkrc_filename = gdm_config_get_string (GDM_KEY_GTKRC);
-
- gtkrc_checkbox = glade_helper_get (xml,
- "gtkrc_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- if (!ve_string_empty (gtkrc_filename) && access (gtkrc_filename, R_OK) == 0) {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (gtkrc_filechooser),
- gtkrc_filename);
-
- gtk_widget_set_sensitive (gtkrc_filechooser, TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtkrc_checkbox), TRUE);
-
- }
- else {
- gtk_widget_set_sensitive (gtkrc_filechooser, FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtkrc_checkbox), FALSE);
- }
-
- g_object_set_data_full (G_OBJECT (gtkrc_filechooser),
- "key", g_strdup (GDM_KEY_GTKRC),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (gtkrc_filechooser), "selection-changed",
- G_CALLBACK (default_filechooser_response),
- NULL);
-
-
- g_object_set_data_full (G_OBJECT (gtkrc_checkbox),
- "key", g_strdup (GDM_KEY_GTKRC),
- (GDestroyNotify) g_free);
-
- g_signal_connect (G_OBJECT (gtkrc_checkbox), "toggled",
- G_CALLBACK (toggle_toggled), gtkrc_checkbox);
- g_signal_connect (G_OBJECT (gtkrc_checkbox), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), gtkrc_filechooser);
-
- g_free (gtkrc_filename);
-
- /* Setup user 24Hr Clock */
- clock_type_chooser = glade_helper_get (xml,
- "use_24hr_clock_combobox",
- GTK_TYPE_COMBO_BOX);
-
- user_24hr_clock = gdm_config_get_string (GDM_KEY_USE_24_CLOCK);
- if (!ve_string_empty (user_24hr_clock)) {
- if (strcasecmp (ve_sure_string (user_24hr_clock), _("auto")) == 0) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (clock_type_chooser), CLOCK_AUTO);
- }
- else if (strcasecmp (ve_sure_string (user_24hr_clock), _("yes")) == 0) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (clock_type_chooser), CLOCK_AUTO);
- }
- else if (strcasecmp (ve_sure_string (user_24hr_clock), _("no")) == 0) {
- gtk_combo_box_set_active (GTK_COMBO_BOX (clock_type_chooser), CLOCK_NO);
- }
- }
-
- g_object_set_data_full (G_OBJECT (clock_type_chooser), "key",
- g_strdup (GDM_KEY_USE_24_CLOCK), (GDestroyNotify) g_free);
- g_signal_connect (G_OBJECT (clock_type_chooser), "changed",
- G_CALLBACK (combobox_changed), NULL);
-
- commands_button = glade_helper_get (xml, "configure_commands_button",
- GTK_TYPE_BUTTON);
- g_signal_connect (G_OBJECT (commands_button), "clicked",
- G_CALLBACK (command_button_clicked), NULL);
-
-}
-
-static void
-setup_local_tab (void)
-{
- setup_local_plain_settings ();
- setup_local_themed_settings ();
-}
-
-static void
-hookup_remote_plain_background (void)
-{
- /* Initialize and hookup callbacks for plain background settings */
- GtkFileFilter *filter;
- GtkWidget *color_radiobutton;
- GtkWidget *color_colorbutton;
- GtkWidget *image_radiobutton;
- GtkWidget *image_filechooser;
- GtkWidget *image_scale_to_fit;
- GtkWidget *image_preview;
- gchar *background_filename;
-
- color_radiobutton = glade_helper_get (xml,
- "remote_background_color_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- color_colorbutton = glade_helper_get (xml,
- "remote_background_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
-
- image_radiobutton = glade_helper_get (xml,
- "remote_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- image_filechooser = glade_helper_get (xml,
- "remote_background_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
- image_scale_to_fit = glade_helper_get (xml,
- "sg_scale_background_remote",
- GTK_TYPE_CHECK_BUTTON);
-
- setup_greeter_color ("remote_background_colorbutton",
- GDM_KEY_BACKGROUND_COLOR);
-
- setup_greeter_toggle ("sg_scale_background_remote",
- GDM_KEY_BACKGROUND_SCALE_TO_FIT);
-
- setup_greeter_toggle ("sg_remote_color_only",
- GDM_KEY_BACKGROUND_REMOTE_ONLY_COLOR);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_scale_to_fit),
- gdm_config_get_bool (GDM_KEY_BACKGROUND_SCALE_TO_FIT));
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (image_filechooser), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern(filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (image_filechooser), filter);
-
- background_filename = gdm_config_get_string (GDM_KEY_BACKGROUND_IMAGE);
-
- if (ve_string_empty (background_filename)) {
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (image_filechooser),
- PIXMAPDIR);
- } else {
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (image_filechooser),
- background_filename);
- }
-
- switch (gdm_config_get_int (GDM_KEY_BACKGROUND_TYPE)) {
-
- case BACKGROUND_IMAGE_AND_COLOR: {
- /* Image & Color background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), TRUE);
- gtk_widget_set_sensitive (image_scale_to_fit, TRUE);
- gtk_widget_set_sensitive (image_filechooser, TRUE);
- gtk_widget_set_sensitive (color_colorbutton, TRUE);
-
- break;
- }
- case BACKGROUND_COLOR: {
- /* Color background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), TRUE);
- gtk_widget_set_sensitive (image_scale_to_fit, FALSE);
- gtk_widget_set_sensitive (image_filechooser, FALSE);
- gtk_widget_set_sensitive (color_colorbutton, TRUE);
-
- break;
- }
- case BACKGROUND_IMAGE: {
- /* Image background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), TRUE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), FALSE);
- gtk_widget_set_sensitive (image_scale_to_fit, TRUE);
- gtk_widget_set_sensitive (image_filechooser, TRUE);
- gtk_widget_set_sensitive (color_colorbutton, FALSE);
-
- break;
- }
- default: {
- /* No background type */
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (image_radiobutton), FALSE);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (color_radiobutton), FALSE);
- gtk_widget_set_sensitive (color_colorbutton, FALSE);
- gtk_widget_set_sensitive (image_scale_to_fit, FALSE);
- gtk_widget_set_sensitive (image_filechooser, FALSE);
- }
- }
-
- gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (image_filechooser),
- FALSE);
- image_preview = gtk_image_new ();
- if (!ve_string_empty (background_filename)) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image_preview),
- create_preview_pixbuf (background_filename));
- }
- gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (image_filechooser),
- image_preview);
- gtk_widget_set_size_request (image_preview, 128, -1);
- gtk_widget_show (image_preview);
-
- g_object_set_data (G_OBJECT (color_radiobutton), "key",
- GDM_KEY_BACKGROUND_TYPE);
- g_object_set_data (G_OBJECT (color_colorbutton), "key",
- GDM_KEY_BACKGROUND_COLOR);
- g_object_set_data (G_OBJECT (image_radiobutton), "key",
- GDM_KEY_BACKGROUND_TYPE);
- g_object_set_data (G_OBJECT (image_filechooser), "key",
- GDM_KEY_BACKGROUND_IMAGE);
- g_object_set_data (G_OBJECT (image_scale_to_fit), "key",
- GDM_KEY_BACKGROUND_SCALE_TO_FIT);
-
- g_signal_connect (G_OBJECT (color_radiobutton), "toggled",
- G_CALLBACK (local_background_type_toggled), NULL);
- g_signal_connect (G_OBJECT (color_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), color_colorbutton);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (local_background_type_toggled), NULL);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), image_filechooser);
- g_signal_connect (G_OBJECT (image_radiobutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), image_scale_to_fit);
- g_signal_connect (G_OBJECT (image_filechooser), "selection-changed",
- G_CALLBACK (background_filechooser_response), image_filechooser);
- g_signal_connect (G_OBJECT (image_filechooser), "update-preview",
- G_CALLBACK (update_image_preview), NULL);
-}
-
-static void
-hookup_remote_plain_behaviour (void)
-{
- /* Setup qiver */
- setup_notify_toggle ("remote_quiver_checkbox", GDM_KEY_QUIVER);
-
- /* Setup show title bar */
- setup_notify_toggle ("remote_title_bar_checkbutton", GDM_KEY_TITLE_BAR);
-
- /* Setup lock position */
- setup_notify_toggle ("remote_lock_pos_checkbox", GDM_KEY_LOCK_POSITION);
-
- /* Setup set position */
- setup_notify_toggle ("remote_set_pos_checkbox", GDM_KEY_SET_POSITION);
-
- /* Setup positionX */
- setup_intspin ("remote_posx_spinbutton", GDM_KEY_POSITION_X);
-
- /* Setup positionX */
- setup_intspin ("remote_posy_spinbutton", GDM_KEY_POSITION_Y);
-}
-
-static void
-hookup_remote_plain_logo (void)
-{
- /* Initialize and hookup callbacks for plain logo settings */
- GtkFileFilter *filter;
- GtkWidget *logo_checkbutton;
- GtkWidget *logo_button;
- GtkWidget *image_preview;
- gchar *logo_filename;
-
- logo_checkbutton = glade_helper_get (xml,
- "remote_logo_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- logo_button = glade_helper_get (xml,
- "remote_logo_image_chooserbutton",
- GTK_TYPE_FILE_CHOOSER_BUTTON);
-
-
- gtk_file_chooser_set_use_preview_label (GTK_FILE_CHOOSER (logo_button),
- FALSE);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("Images"));
- gtk_file_filter_add_pixbuf_formats (filter);
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (logo_button), filter);
-
- filter = gtk_file_filter_new ();
- gtk_file_filter_set_name (filter, _("All Files"));
- gtk_file_filter_add_pattern(filter, "*");
- gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (logo_button), filter);
-
- logo_filename = gdm_config_get_string (GDM_KEY_LOGO);
-
- if (ve_string_empty (logo_filename)) {
- logo_filename = gdm_config_get_string (GDM_KEY_CHOOSER_BUTTON_LOGO);
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (logo_checkbutton),
- FALSE);
- gtk_widget_set_sensitive (logo_button, FALSE);
- }
- else {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (logo_checkbutton),
- TRUE);
- gtk_widget_set_sensitive (logo_button, TRUE);
- }
-
- if (ve_string_empty (logo_filename))
- gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (logo_button),
- PIXMAPDIR);
- else
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (logo_button), logo_filename);
-
- image_preview = gtk_image_new ();
- if (!ve_string_empty (logo_filename)) {
- gtk_image_set_from_pixbuf (GTK_IMAGE (image_preview),
- create_preview_pixbuf (logo_filename));
- }
- gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (logo_button),
- image_preview);
- gtk_widget_set_size_request (image_preview, 128, -1);
- gtk_widget_show (image_preview);
-
- g_object_set_data (G_OBJECT (logo_button), "key",
- GDM_KEY_LOGO);
- g_object_set_data (G_OBJECT (logo_checkbutton), "key",
- GDM_KEY_LOGO);
-
- g_signal_connect (G_OBJECT (logo_checkbutton), "toggled",
- G_CALLBACK (logo_toggle_toggled), NULL);
- g_signal_connect (G_OBJECT (logo_checkbutton), "toggled",
- G_CALLBACK (toggle_toggled_sensitivity_positive), logo_button);
- g_signal_connect (G_OBJECT (logo_button), "selection-changed",
- G_CALLBACK (logo_filechooser_response), logo_button);
- g_signal_connect (G_OBJECT (logo_button), "update-preview",
- G_CALLBACK (update_image_preview), NULL);
-}
-
-static void
-setup_remote_plain_settings (void)
-{
- GtkSizeGroup *size_group;
- GtkWidget *image_checkbutton;
- GtkWidget *color_checkbutton;
-
- image_checkbutton = glade_helper_get (xml, "remote_background_image_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
- color_checkbutton = glade_helper_get (xml, "remote_background_color_checkbutton",
- GTK_TYPE_CHECK_BUTTON);
-
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (size_group, image_checkbutton);
- gtk_size_group_add_widget (size_group, color_checkbutton);
-
- /* Style setting */
- setup_greeter_combobox ("remote_greeter",
- GDM_KEY_REMOTE_GREETER);
-
- /* Plain background settings */
- hookup_remote_plain_background ();
-
- /* Plain behaviour settings */
- hookup_remote_plain_behaviour ();
-
- /* Plain logo settings */
- hookup_remote_plain_logo ();
-
- /* Remote welcome message settings */
- setup_remote_welcome_message ();
-}
-
-static void
-setup_remote_themed_settings (void)
-{
- gboolean GdmGraphicalThemeRand;
- GtkListStore *store;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
- GtkTreeIter *select_iter = NULL;
- GtkWidget *color_colorbutton;
- GtkWidget *style_label;
- GtkWidget *theme_label;
- GtkSizeGroup *size_group;
-
- GtkWidget *theme_list = glade_helper_get (xml, "gg_theme_list_remote",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *theme_list_local = glade_helper_get (xml, "gg_theme_list",
- GTK_TYPE_TREE_VIEW);
- GtkWidget *button = glade_helper_get (xml, "gg_install_new_theme_remote",
- GTK_TYPE_BUTTON);
- GtkWidget *del_button = glade_helper_get (xml, "gg_delete_theme_remote",
- GTK_TYPE_BUTTON);
- GtkWidget *mode_combobox = glade_helper_get (xml, "gg_mode_combobox_remote",
- GTK_TYPE_COMBO_BOX);
-
- style_label = glade_helper_get (xml, "remote_stylelabel", GTK_TYPE_LABEL);
- theme_label = glade_helper_get (xml, "remote_theme_label", GTK_TYPE_LABEL);
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
- gtk_size_group_add_widget (size_group, style_label);
- gtk_size_group_add_widget (size_group, theme_label);
-
- color_colorbutton = glade_helper_get (xml,
- "remote_background_theme_colorbutton",
- GTK_TYPE_COLOR_BUTTON);
-
- g_object_set_data (G_OBJECT (color_colorbutton), "key",
- GDM_KEY_GRAPHICAL_THEMED_COLOR);
-
- setup_greeter_color ("remote_background_theme_colorbutton",
- GDM_KEY_GRAPHICAL_THEMED_COLOR);
-
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (theme_list), TRUE);
-
- GdmGraphicalThemeRand = gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
-
- /* Register theme mode combobox */
- g_object_set_data_full (G_OBJECT (mode_combobox), "key",
- g_strdup (GDM_KEY_GRAPHICAL_THEME_RAND),
- (GDestroyNotify) g_free);
-
- store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (theme_list_local)));
- gtk_tree_view_set_model (GTK_TREE_VIEW (theme_list),
- GTK_TREE_MODEL (store));
- /* Signals */
- g_signal_connect (mode_combobox, "changed",
- G_CALLBACK (combobox_changed), NULL);
- g_signal_connect (button, "clicked",
- G_CALLBACK (install_new_theme), store);
- g_signal_connect (del_button, "clicked",
- G_CALLBACK (delete_theme), store);
-
- /* Init controls */
- gtk_widget_set_sensitive (del_button, FALSE);
- gtk_combo_box_set_active (GTK_COMBO_BOX (mode_combobox),
- GdmGraphicalThemeRand);
-
- /* The radio toggle column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_toggle_new ();
- gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer),
- TRUE);
- g_signal_connect (G_OBJECT (renderer), "toggled",
- G_CALLBACK (selected_toggled), store);
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "active", THEME_COLUMN_SELECTED, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
- gtk_tree_view_column_set_visible(column, !GdmGraphicalThemeRand);
-
- /* The checkbox toggle column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_toggle_new ();
- gtk_cell_renderer_toggle_set_radio (GTK_CELL_RENDERER_TOGGLE (renderer),
- FALSE);
- g_signal_connect (G_OBJECT (renderer), "toggled",
- G_CALLBACK (selected_toggled), store);
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer, "active",
- THEME_COLUMN_SELECTED_LIST, NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
- gtk_tree_view_column_set_visible (column, GdmGraphicalThemeRand);
-
- /* The preview column */
- column = gtk_tree_view_column_new ();
- renderer = gtk_cell_renderer_pixbuf_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "pixbuf", THEME_COLUMN_SCREENSHOT,
- NULL);
-
- /* The markup column */
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_column_pack_start (column, renderer, FALSE);
- gtk_tree_view_column_set_attributes (column, renderer,
- "markup", THEME_COLUMN_MARKUP, NULL);
- gtk_tree_view_column_set_spacing (column, 6);
- gtk_tree_view_append_column (GTK_TREE_VIEW (theme_list), column);
-
- gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
- THEME_COLUMN_MARKUP, GTK_SORT_ASCENDING);
-
- gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (theme_list),
- theme_list_equal_func, NULL, NULL);
-
- /* Selection setup */
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (theme_list));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- g_signal_connect (selection, "changed",
- G_CALLBACK (gg_selection_changed), NULL);
-
- gtk_drag_dest_set (theme_list,
- GTK_DEST_DEFAULT_ALL,
- target_table, n_targets,
- GDK_ACTION_COPY);
-
- g_signal_connect (theme_list, "drag_data_received",
- G_CALLBACK (theme_list_drag_data_received), NULL);
-
- if (select_iter != NULL) {
- gtk_tree_selection_select_iter (selection, select_iter);
- g_free (select_iter);
- }
-}
-
-static void
-setup_remote_tab (void)
-{
- GtkWidget *xdmcp_button;
-
- xdmcp_button = glade_helper_get (xml, "xdmcp_configbutton",
- GTK_TYPE_BUTTON);
-
-#ifndef HAVE_LIBXDMCP
- gtk_widget_set_sensitive (xdmcp_button, FALSE);
-#else
- g_signal_connect (G_OBJECT (xdmcp_button), "clicked",
- G_CALLBACK (xdmcp_button_clicked), NULL);
-#endif
-
- setup_remote_plain_settings ();
- setup_remote_themed_settings ();
-}
-
-
-static GtkWidget *
-setup_gui (void)
-{
- GtkWidget *dialog;
-
- xml = glade_helper_load ("gdmsetup.glade",
- "setup_dialog",
- GTK_TYPE_DIALOG,
- TRUE /* dump_on_destroy */);
-
- dialog = glade_helper_get (xml, "setup_dialog", GTK_TYPE_DIALOG);
-
- g_signal_connect (G_OBJECT (dialog), "delete_event",
- G_CALLBACK (delete_event), NULL);
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (dialog_response), NULL);
-
- setup_notebook = glade_helper_get (xml, "setup_notebook",
- GTK_TYPE_NOTEBOOK);
-
- /* Markup glade labels */
- glade_helper_tagify_label (xml, "themes_label", "b");
- glade_helper_tagify_label (xml, "sounds_label", "b");
- glade_helper_tagify_label (xml, "local_background_label", "b");
- glade_helper_tagify_label (xml, "local_behaviour_label", "b");
- glade_helper_tagify_label (xml, "local_logo_label", "b");
- glade_helper_tagify_label (xml, "local_menubar_label", "b");
- glade_helper_tagify_label (xml, "local_welcome_message_label", "b");
- glade_helper_tagify_label (xml, "label_welcome_note", "i");
- glade_helper_tagify_label (xml, "label_welcome_note", "small");
- glade_helper_tagify_label (xml, "gg_author_label", "b");
- glade_helper_tagify_label (xml, "gg_author_label", "small");
- glade_helper_tagify_label (xml, "gg_copyright_label", "b");
- glade_helper_tagify_label (xml, "gg_copyright_label", "small");
- glade_helper_tagify_label (xml, "remote_plain_background_label", "b");
- glade_helper_tagify_label (xml, "remote_behaviour_label", "b");
- glade_helper_tagify_label (xml, "remote_logo_label", "b");
- glade_helper_tagify_label (xml, "remote_welcome_message_label", "b");
- glade_helper_tagify_label (xml, "label_welcomeremote_note", "i");
- glade_helper_tagify_label (xml, "label_welcomeremote_note", "small");
- glade_helper_tagify_label (xml, "autologin", "b");
- glade_helper_tagify_label (xml, "timedlogin", "b");
- glade_helper_tagify_label (xml, "security_label", "b");
- glade_helper_tagify_label (xml, "fb_informationlabel", "i");
- glade_helper_tagify_label (xml, "fb_informationlabel", "small");
-
- /* Setup preference tabs */
- setup_general_tab ();
- setup_local_tab ();
- setup_remote_tab ();
- setup_accessibility_tab ();
- setup_security_tab ();
- setup_users_tab ();
-
- return (dialog);
-}
-
-static gboolean
-get_sensitivity (void)
-{
- static Atom atom = 0;
- Display *disp = gdk_x11_get_default_xdisplay ();
- Window root = gdk_x11_get_default_root_xwindow ();
- unsigned char *datac;
- gulong *data;
- gulong nitems_return;
- gulong bytes_after_return;
- Atom type_returned;
- int format_returned;
-
- if (atom == 0)
- atom = XInternAtom (disp, "_GDM_SETUP_INSENSITIVE", False);
-
- if (XGetWindowProperty (disp,
- root,
- atom,
- 0, 1,
- False,
- XA_CARDINAL,
- &type_returned, &format_returned,
- &nitems_return,
- &bytes_after_return,
- &datac) != Success)
- return TRUE;
-
- data = (gulong *)datac;
-
- if (format_returned != 32 ||
- data[0] == 0) {
- XFree (data);
- return TRUE;
- } else {
- XFree (data);
- return FALSE;
- }
-}
-
-static void
-update_sensitivity (void)
-{
- gboolean sensitive = get_sensitivity ();
- GtkWidget *setup_dialog = glade_helper_get (xml, "setup_dialog",
- GTK_TYPE_WINDOW);
- gtk_widget_set_sensitive (setup_dialog, sensitive);
- if (sensitive)
- unsetup_window_cursor ();
- else
- setup_window_cursor (GDK_WATCH);
-}
-
-static GdkFilterReturn
-root_window_filter (GdkXEvent *gdk_xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xevent = (XEvent *)gdk_xevent;
-
- if (xevent->type == PropertyNotify)
- update_sensitivity ();
-
- return GDK_FILTER_CONTINUE;
-}
-
-static void
-setup_disable_handler (void)
-{
- XWindowAttributes attribs = { 0, };
- Display *disp = gdk_x11_get_default_xdisplay ();
- Window root = gdk_x11_get_default_root_xwindow ();
-
- update_sensitivity ();
-
- /* set event mask for events on root window */
- XGetWindowAttributes (disp, root, &attribs);
- XSelectInput (disp, root,
- attribs.your_event_mask |
- PropertyChangeMask);
-
- gdk_window_add_filter (gdk_get_default_root_window (),
- root_window_filter, NULL);
-}
-
-static gboolean
-gdm_event (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GdkEvent *event;
-
- /* HAAAAAAAAAAAAAAAAACK */
- /* Since the user has not logged in yet and may have left/right
- * mouse buttons switched, we just translate every right mouse click
- * to a left mouse click */
- if (n_param_values != 2 ||
- !G_VALUE_HOLDS (&param_values[1], GDK_TYPE_EVENT))
- return FALSE;
-
- event = g_value_get_boxed (&param_values[1]);
- if ((event->type == GDK_BUTTON_PRESS ||
- event->type == GDK_2BUTTON_PRESS ||
- event->type == GDK_3BUTTON_PRESS ||
- event->type == GDK_BUTTON_RELEASE)
- && event->button.button == 3)
- event->button.button = 1;
-
- return TRUE;
-}
-
-static void
-apply_user_changes (GObject *object, gint arg1, gpointer user_data)
-{
- GtkWidget *dialog = user_data;
-
-
- /* This is pretty ugly but it is probable
- that both events can occur simultaneously.
- Then we display two dialogs - one after the other.
- Lets hope that although probable this scenario
- does not araise very often */
- if (GdmRandomFromSelectedChangesWarn == TRUE) {
-
- GtkWidget *prompt;
-
- prompt = ve_hig_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK,
- _("Random theme mode change"),
- _("Since no themes were selected in random theme mode"
- " switching back to single theme mode."));
-
- gtk_dialog_run (GTK_DIALOG (prompt));
- gtk_widget_destroy (prompt);
-
- }
-
- if (GdmUserChangesUnsaved == TRUE) {
-
- GtkWidget *prompt;
- gint response;
-
- prompt = ve_hig_dialog_new (GTK_WINDOW (dialog),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Apply the changes to users before closing?"),
- _("If you don't apply, the changes made on "
- "the Users tab will be disregarded."));
-
- gtk_dialog_add_button (GTK_DIALOG (prompt), _("Close _without Applying"), GTK_RESPONSE_CLOSE);
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-cancel", GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (prompt), "gtk-apply", GTK_RESPONSE_APPLY);
-
- response = gtk_dialog_run (GTK_DIALOG (prompt));
- gtk_widget_destroy (prompt);
-
- if (response == GTK_RESPONSE_APPLY) {
- GtkWidget *apply_button;
-
- apply_button = glade_helper_get (xml, "fb_faceapply",
- GTK_TYPE_WIDGET);
- g_signal_emit_by_name (G_OBJECT (apply_button), "clicked");
- }
-
- gtk_main_quit ();
-
- if (response == GTK_RESPONSE_CANCEL) {
- gtk_main ();
- }
- }
-}
-
-int
-main (int argc, char *argv[])
-{
- GtkWidget *dialog;
- char **list;
- gint GdmMinimalUID;
- int i;
-
- gdm_config_never_cache (TRUE);
-
- if (g_getenv ("DOING_GDM_DEVELOPMENT") != NULL)
- DOING_GDM_DEVELOPMENT = TRUE;
- if (g_getenv ("RUNNING_UNDER_GDM") != NULL)
- RUNNING_UNDER_GDM = TRUE;
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- gtk_init (&argc, &argv);
-
- /* Lets check if gdm daemon is running
- if no there is no point in continuing
- */
- gdm_running = gdmcomm_check (TRUE);
- if (gdm_running == FALSE)
- exit (EXIT_FAILURE);
-
- gtk_window_set_default_icon_from_file (DATADIR"/pixmaps/gdm-setup.png", NULL);
- glade_init();
-
- /* Start using socket */
- gdmcomm_comm_bulk_start ();
-
- config_file = gdm_common_get_config_file ();
- if (config_file == NULL) {
- GtkWidget *dialog;
-
- /* Done using socket */
- gdmcomm_comm_bulk_stop ();
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Could not access configuration file (defaults.conf)"),
- _("Make sure that the file exists before launching login manager config utility."));
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- exit (EXIT_FAILURE);
- }
- custom_config_file = gdm_common_get_custom_config_file ();
- if (custom_config_file == NULL) {
- GtkWidget *dialog;
-
- /* Done using socket */
- gdmcomm_comm_bulk_stop ();
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Could not access configuration file (custom.conf)"),
- _("Make sure that the file exists before launching login manager config utility."));
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- exit (EXIT_FAILURE);
- }
-
- if (RUNNING_UNDER_GDM) {
- char *gtkrc;
- char *theme_name;
-
- /* Set busy cursor */
- setup_cursor (GDK_WATCH);
-
- /* parse the given gtk rc first */
- gtkrc = gdm_config_get_string (GDM_KEY_GTKRC);
- if ( ! ve_string_empty (gtkrc))
- gtk_rc_parse (gtkrc);
-
- theme_name = g_strdup (g_getenv ("GDM_GTK_THEME"));
- if (ve_string_empty (theme_name)) {
- g_free (theme_name);
- theme_name = gdm_config_get_string (GDM_KEY_GTK_THEME);
- gdm_set_theme (theme_name);
- } else {
- gdm_set_theme (theme_name);
- }
-
- /* evil, but oh well */
- g_type_class_ref (GTK_TYPE_WIDGET);
- }
-
- glade_helper_add_glade_directory (GDM_GLADE_DIR);
-
- /* Make sure the user is root. If not, they shouldn't be messing with
- * GDM's configuration.
- */
-
- if ( ! DOING_GDM_DEVELOPMENT &&
- geteuid() != 0) {
- GtkWidget *fatal_error;
-
- /* Done using socket */
- gdmcomm_comm_bulk_stop ();
-
- fatal_error =
- ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("You must be the root user to configure GDM."),
- "");
- if (RUNNING_UNDER_GDM)
- setup_cursor (GDK_LEFT_PTR);
- gtk_dialog_run (GTK_DIALOG (fatal_error));
- exit (EXIT_FAILURE);
- }
-
- /*
- * XXX: the setup proggie using a greeter config var for it's
- * ui? Say it ain't so. Our config sections are SUCH A MESS
- */
- GdmIconMaxHeight = gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- GdmIconMaxWidth = gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- GdmIncludeAll = gdm_config_get_bool (GDM_KEY_INCLUDE_ALL);
- GdmInclude = gdm_config_get_string (GDM_KEY_INCLUDE);
-
- /* We need to make sure that the users in the include list exist
- and have uid that are higher than MinimalUID. This protects us
- from invalid data obtained from the config file */
- GdmMinimalUID = gdm_config_get_int (GDM_KEY_MINIMAL_UID);
- list = g_strsplit (GdmInclude, ",", 0);
- for (i=0; list != NULL && list[i] != NULL; i++) {
- if (gdm_is_user_valid (list[i]) && gdm_user_uid (list[i]) >= GdmMinimalUID)
- continue;
-
- GdmInclude = strings_list_remove (GdmInclude, list[i], ",");
- }
- g_strfreev (list);
-
- GdmExclude = gdm_config_get_string (GDM_KEY_EXCLUDE);
- GdmSoundProgram = gdm_config_get_string (GDM_KEY_SOUND_PROGRAM);
-
- if (ve_string_empty (GdmSoundProgram) ||
- g_access (GdmSoundProgram, X_OK) != 0) {
- GdmSoundProgram = NULL;
- }
-
- xservers = gdm_config_get_xservers (FALSE);
-
- /* Done using socket */
- gdmcomm_comm_bulk_stop ();
-
- /* Once we corrected the include list we need to save it if
- it was modified */
- if ( strcmp (ve_sure_string (gdm_config_get_string (GDM_KEY_INCLUDE)), ve_sure_string (GdmInclude)) != 0)
- gdm_setup_config_set_string (GDM_KEY_INCLUDE, GdmInclude);
-
- dialog = setup_gui ();
-
- g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (apply_user_changes), dialog);
- gtk_widget_show (dialog);
-
- if (RUNNING_UNDER_GDM) {
- guint sid;
-
- /* also setup third button to work as first to work
- in reverse situations transparently */
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- setup_disable_handler ();
-
- setup_cursor (GDK_LEFT_PTR);
- }
-
- gtk_main ();
-
- return 0;
-}
-
-/* EOF */
diff --git a/gui/gdmsetup.desktop.in.in b/gui/gdmsetup.desktop.in.in
deleted file mode 100644
index 0cd1782a..00000000
--- a/gui/gdmsetup.desktop.in.in
+++ /dev/null
@@ -1,14 +0,0 @@
-[Desktop Entry]
-Encoding=UTF-8
-_Name=Login Window
-_Comment=Configure GDM login window appearance and behavior
-TryExec=@sbindir@/gdmsetup
-Exec=@sbindir@/gdmsetup
-Icon=gdm-setup
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=GNOME;GTK;Settings;System;
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=gdm
-X-GNOME-Bugzilla-Component=general
diff --git a/gui/gdmsetup.glade b/gui/gdmsetup.glade
deleted file mode 100644
index bd17eb4d..00000000
--- a/gui/gdmsetup.glade
+++ /dev/null
@@ -1,9923 +0,0 @@
-<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
-<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
-
-<glade-interface>
-
-<widget class="GtkDialog" id="setup_dialog">
- <property name="title" translatable="yes">Login Window Preferences</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox">
- <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_area">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="helpbutton2">
- <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="okbutton1">
- <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>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEventBox" id="eventbox1">
- <property name="visible">True</property>
- <property name="visible_window">True</property>
- <property name="above_child">False</property>
-
- <child>
- <widget class="GtkNotebook" id="setup_notebook">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="show_tabs">True</property>
- <property name="show_border">True</property>
- <property name="tab_pos">GTK_POS_TOP</property>
- <property name="scrollable">False</property>
- <property name="enable_popup">False</property>
-
- <child>
- <widget class="GtkVBox" id="general_tab_vbox">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox201">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="table24">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="vis_feedback_passwd_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Show visual feedback is the password entry. Turning this option on can be a security hazard as the length of your password can be guessed.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Show visual feedback (asterisks) in the password entry</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox203">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label297">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="use_circles_passwd_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Use circles instead of asterisks in the password entry. This may not work with all fonts however.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Use circles instead of asterisks in the password entry</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="a_restart_server_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Does not reuse existing X servers, but kills them and starts over. Normally, just reinitializing is a nicer way to go but if the X server memory usage keeps growing this may be a safer option.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Restart the Xserver with each login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="a_login_curr_session_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">When the user logs in and already has an existing session, they are connected to that session rather than starting a new session. This only works for session's running on Virtual Terminals started with gdmflexiserver, and not with XDMCP.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Disa_ble multiple logins for a single user</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table25">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">1</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="table30">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkComboBox" id="default_session_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes"></property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label348">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Us_e 24 Hour Clock:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">use_24hr_clock_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="gtkrc_chooserbutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="title" translatable="yes">Select Background Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="use_24hr_clock_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes">auto
-yes
-no</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="default_session_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The session that is used by default if the user does not have a saved preference and has picked 'Last' from the list of sessions.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">De_fault session:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="gtkrc_checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_GtkRC file:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</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="hbox9923">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkButton" id="configure_commands_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">E_dit Commands...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="general_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">General</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</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="local_tab_vbox">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="local_style_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="local_style_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="local_stylelabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Style:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">local_greeter</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="local_greeter">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Plain
-Plain with face browser
-Themed</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="local_properties_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkVBox" id="local_plain_properties_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="local_plain_background_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFixed" id="local_plain_fixed">
- <property name="height_request">6</property>
- <property name="visible">True</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="local_background_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Background</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="local_background_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="local_background_indent_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.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="local_background_table">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">3</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="local_background_image_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Displays this image as the background in the greeter.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Image:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="local_background_image_chooserbutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="title" translatable="yes">Select Background Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="local_background_scale_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="local_background_scale_indent_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.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sg_scale_background">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Scale background image to fit the screen.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sc_ale to fit screen</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkColorButton" id="local_background_colorbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Pick Background Color</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox199">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="local_background_color_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Background color of the greeter.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Co_lor:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</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>
-
- <child>
- <widget class="GtkLabel" id="local_behaviour_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Behaviour</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox143">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9933">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label506">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="local_quiver_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Shake the display when an incorrect username/password is entered.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Qui_ver when incorrect username/password entered</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="hbox9934">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label507">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="local_title_bar_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Display the title bar in the greeter.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sh_ow title bar</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="hbox9935">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label508">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="local_lock_pos_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The position of the login window cannot be changed.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Loc_k position of the window</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9936">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label509">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="local_set_pos_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The position of the login window is determined by Position X / Position Y.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Set positio_n of the window:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="label510">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> _X coordinate</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">local_posx_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="local_posx_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The horizontal position of the login window.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label511">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Y coordinate</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">local_posy_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="local_posy_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The vertical position of the login window.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</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>
- <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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="local_plain_logo_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="local_logo_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Logo</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox102">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label169">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox104">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="local_logo_image_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Image file to display in the logo box. The file must be in an gdk-pixbuf supported format and it must be readable by the GDM user. If no file is specified the logo feature is disabled.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">I_mage:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="local_logo_image_chooserbutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="title" translatable="yes">Select Logo Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </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>
- <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">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="GtkVBox" id="local_themed_properties_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox128">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="local_theme_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Theme:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gg_mode_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="gg_mode_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Selected only
-Random from selected
-</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox92">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="local_theme_scrolled_window">
- <property name="width_request">350</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="gg_theme_list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</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="vbox56">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="gg_install_new_theme">
- <property name="visible">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="alignment5">
- <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="hbox107">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image1">
- <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="label173">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="gg_delete_theme">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment6">
- <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="hbox108">
- <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-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="LocalThemeRemoveButtonLabel">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox87">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkVBox" id="vbox89">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="gg_copyright_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Copyright:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow11">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="gg_copyright_text_view">
- <property name="visible">True</property>
- <property name="editable">False</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">False</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </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">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox88">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="gg_author_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow12">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="gg_author_text_view">
- <property name="visible">True</property>
- <property name="editable">False</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">False</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </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">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </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">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="GtkVBox" id="vbox90">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox129">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="table14">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label207">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Background color:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">local_background_theme_colorbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkColorButton" id="local_background_theme_colorbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Pick Background Color</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand</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>
- <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>
- </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>
-
- <child>
- <widget class="GtkVBox" id="local_welcome_message_vbox1">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="LocalPlainMenuBarVBox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="local_menubar_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Menu Bar</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox103">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label170">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox73">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkCheckButton" id="sysmenu">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Turns the Actions menu (which used to be called System menu) on or off. If this is off then one of the actions will be available anywhere. These actions include Shutdown, Restart, Custom, Configure, XDMCP chooser and such.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sho_w Actions menu</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox105">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label171">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="config_available">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Allows the configurator to be run from the greeter. Note that the user will need to type in the root password before the configurator will be started.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Include Con_figure menu item</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox106">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label172">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="chooser_button">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Adds a chooser button to the Actions menu that will restart the current X server with a chooser. XDMCP does not need to be enabled on the local computer for this to work.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Includ_e Hostname Chooser (XDMCP) menu item</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">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>
- <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>
-
- <child>
- <widget class="GtkVBox" id="vbox128">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="local_welcome_message_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Welcome Message</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="local_welcome_message_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="local_welcome_message_indent">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="local_welcome_message_vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkRadioButton" id="sg_defaultwelcome">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Default: &quot;Welcome&quot;</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="local_welcome_message_table">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkRadioButton" id="sg_customwelcome">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Controls which text to display next to the logo image in the standard greeter. This string is only used for local logins.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">C_ustom:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">sg_defaultwelcome</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="welcome">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label_welcome_note">
- <property name="visible">True</property>
- <property name="label" translatable="yes">%n will be replaced by hostname</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </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>
- </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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="local_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Local</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="remote_tab_vbox">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox78">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox116">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="remote_stylelabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Style:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">remote_greeter</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="remote_greeter">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Remote login disabled
-Same as Local</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox79">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkVBox" id="remote_plain_properties_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox81">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFixed" id="fixed2">
- <property name="height_request">6</property>
- <property name="visible">True</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="remote_plain_background_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Background</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox117">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label186">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox127">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkHBox" id="remote_background_image_hhox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="remote_background_image_checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Image:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="remote_background_image_chooserbutton">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select Background Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </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>
-
- <child>
- <widget class="GtkHBox" id="sg_scale_background_remote_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label187">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sg_scale_background_remote">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sc_ale to fit screen</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox127">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label198">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="sg_remote_color_only">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Do not show image for _remote logins</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="remote_background_color_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="remote_background_color_checkbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Co_lor:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkColorButton" id="remote_background_colorbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Pick Background Color</property>
- <property name="focus_on_click">True</property>
- </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>
- <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>
-
- <child>
- <widget class="GtkLabel" id="remote_behaviour_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Behaviour</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox144">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9937">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label512">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="remote_quiver_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Shake the display when an incorrect username/password is entered.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Qui_ver when incorrect username/password entered</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="hbox9938">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label513">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="remote_title_bar_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Display the title bar in the greeter.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Sh_ow title bar</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9939">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label514">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="remote_lock_pos_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The position of the login window cannot be changed.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Loc_k position of the window</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9940">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label515">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="remote_set_pos_checkbox">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The position of the login window is determined by Position X / Position Y.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Set positio_n of the window:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="label516">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_X coordinate</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">remote_posx_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="remote_posx_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The horizontal position of the login window.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 3000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label517">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Y coordinate</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">remote_posy_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="remote_posy_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The vertical position of the login window.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 3000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</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>
- <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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="remote_plain_logo_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="remote_logo_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Logo</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox122">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label193">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="remote_plain_logo_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="remote_logo_image_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Image file to display in the logo box. The file must be in an gdk-pixbuf supported format and it must be readable by the GDM user. If no file is specified the logo feature is disabled.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">I_mage:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="remote_logo_image_chooserbutton">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select Logo Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </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>
- <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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="remote_themed_properties_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox91">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="remote_theme_mode_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="remote_theme_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Theme:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gg_mode_combobox_remote</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="gg_mode_combobox_remote">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Selected only
-Random from selected
-</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="remote_theme_select_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow13">
- <property name="width_request">350</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="gg_theme_list_remote">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</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="vbox92">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="gg_install_new_theme_remote">
- <property name="visible">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="alignment9">
- <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="hbox132">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image5">
- <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="label209">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="gg_delete_theme_remote">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment10">
- <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="hbox133">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="remove_image">
- <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="label210">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox93">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkVBox" id="vbox94">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label211">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Copyright:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow14">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="gg_copyright_text_view_remote">
- <property name="visible">True</property>
- <property name="editable">False</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">False</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </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">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox95">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkLabel" id="label212">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Author:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow15">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="shadow_type">GTK_SHADOW_NONE</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTextView" id="gg_author_text_view_remote">
- <property name="visible">True</property>
- <property name="editable">False</property>
- <property name="overwrite">False</property>
- <property name="accepts_tab">True</property>
- <property name="justification">GTK_JUSTIFY_LEFT</property>
- <property name="wrap_mode">GTK_WRAP_WORD</property>
- <property name="cursor_visible">False</property>
- <property name="pixels_above_lines">0</property>
- <property name="pixels_below_lines">0</property>
- <property name="pixels_inside_wrap">0</property>
- <property name="left_margin">0</property>
- <property name="right_margin">0</property>
- <property name="indent">0</property>
- <property name="text" translatable="yes"></property>
- </widget>
- </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">False</property>
- <property name="fill">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <placeholder/>
- </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">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="GtkVBox" id="vbox96">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox134">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="remote_theme_background_hbox">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label215">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Background color:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">remote_background_theme_colorbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkColorButton" id="remote_background_theme_colorbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="use_alpha">False</property>
- <property name="title" translatable="yes">Pick Background Color</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options">expand</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>
- <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>
- </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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="remote_welcome_message_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="remote_welcome_message_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Welcome Message</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox98">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label161">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox66">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">3</property>
-
- <child>
- <widget class="GtkRadioButton" id="sg_defaultwelcomeremote">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Default: &quot;Welcome to %n&quot;</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table11">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">0</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkRadioButton" id="sg_customwelcomeremote">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Controls which text to display next to the logo image in the greeter for remote XDMCP sessions.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">C_ustom:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">sg_defaultwelcomeremote</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="welcomeremote">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label_welcomeremote_note">
- <property name="visible">True</property>
- <property name="label" translatable="yes">%n will be replaced by hostname</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </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>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="remote_configure_xdmcp_vbox">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="remove_configure_xdmcp_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkButton" id="xdmcp_configbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Configure XDMC_P...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </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">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>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="remote_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Remote</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="accessibility_tab_vbox">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkCheckButton" id="acc_modules">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Enables greeter to be launched with additional Gtk+ modules. This is useful when extra features are required such as accessible login. Note that only &quot;trusted&quot; modules should be used to minimize security issues.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Enable accessible login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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="themes_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="themes_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Themes</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="themes_category_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="themes_indent_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.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="acc_theme">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Allow changing the GTK+ (widget) theme from the greeter. Currently this only affects the standard greeter. The theme will stay in effect on this display until changed and will affect all the other windows that are put up by GDM.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Allow users to change fonts and colors of plain greeter</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="sounds_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="sounds_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sounds</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="sounds_category_hbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="sounds_indent_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.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="sounds_table">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="acc_sound_ready">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The greeter will play a sound or beep when it is ready for a login.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Login screen ready:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="acc_sound_success">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The greeter will play a sound after a successful login attempt.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Login _successful:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="acc_sound_failure">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The greeter will play a sound after a failed login attempt.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Login _failed:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox182">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFileChooserButton" id="acc_sound_ready_button">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select Sound File</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="acc_soundtest_ready_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-media-play</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox183">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFileChooserButton" id="acc_sound_success_button">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select Sound File</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="acc_soundtest_success_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-media-play</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox184">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkFileChooserButton" id="acc_sound_failure_button">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select Sound File</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="acc_soundtest_failure_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-media-play</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options">fill</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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="accessibility_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Accessibility</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="security_tab_vbox">
- <property name="border_width">12</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="autologin_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="autologin">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Given user should be logged in upon first bootup. No password will be asked. This is useful for single user workstations where local console security is not an issue.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Enable Automatic Login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox136">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label227">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table17">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="autologin_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_User:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">autologin_combo</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBoxEntry" id="autologin_combo">
- <property name="visible">True</property>
- <property name="items" translatable="yes">dummy</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="timedlogin_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="timedlogin">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Given user should be logged in after a number of seconds (set with Pause before login) of inactivity on the login screen. This is useful for public access terminals or perhaps even home use.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Enable _Timed Login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox138">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label231">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table18">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="timed_login_label">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="label" translatable="yes">U_ser:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">timedlogin_combo</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="allowremoteauto">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="tooltip" translatable="yes">Remote connections through XDMCP will be allowed to log into the &quot;TimedLogin&quot; user by letting the login window time out, just like the local user on the first console.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Allo_w remote timed logins</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox148">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="timedlogin_seconds_label">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="label" translatable="yes">_Pause before login:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">timedlogin_seconds</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox141">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkSpinButton" id="timedlogin_seconds">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="tooltip" translatable="yes">Delay in seconds before the Timed login user will be logged in.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">0 10 100 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="timedlogin_seconds_units">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="label" translatable="yes">seconds</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBoxEntry" id="timedlogin_combo">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="items" translatable="yes">dummy</property>
- <property name="add_tearoffs">False</property>
- <property name="has_frame">True</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="security_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox101">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="security_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Security</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox142">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label238">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox102">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table31">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label351">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Login _retry delay:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">retry_delay</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label353">
- <property name="visible">True</property>
- <property name="label" translatable="yes">seconds</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label392">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Minimal UID:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">minimal_uid_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="retry_delay">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The number of seconds that should pass before reactivating the entry field after a failed login.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="minimal_uid_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">All users with a lower UID will be excluded from the face browser, automatic and timed login.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 10000000 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></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="GtkVBox" id="vbox142">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkCheckButton" id="allowroot">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Allow local system administrator login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="allowremoteroot">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">A_llow remote system administrator login</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="enable_debug">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Sends debug ouput to the syslog. This can be useful for tracking down problems with GDM. This output tends to be verbose so should not be turned on for general use.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ena_ble debug messages to system log</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="disallow_tcp">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Always append -nolisten tcp to the command line of local X servers, thus disallowing TCP connection. This is useful if you do not care for allowing remote connections, since the X protocol could really be potentially a security hazard to leave open, even though no known security problems exist. Also disables X forwarding, but does not affect XDMCP.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Deny TCP connections to Xserver</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9932">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label505">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="never_cookies_NFS_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Does not place cookies into the users home directory if this directory is on NFS.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Ne_ver place cookies on NFS</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="check_dir_owner_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Checks the ownership of the home directories before writing to them. This prevents security issues in case of bad setup.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Only allow login i_f user owns their home directory</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox130">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label447">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Permissions</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">gg_mode_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9899">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label448">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox131">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkRadioButton" id="relax_permissions0_radiobutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Paranoia option. Only accepts user owned files and directories.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Only allow login if user's home directory permissions are secure</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="relax_permissions1_radiobutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Allow group writable files and directories.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Allow logi_n if group write permissions on user's home directory</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">relax_permissions0_radiobutton</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkRadioButton" id="relax_permissions2_radiobutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Allow world writable files and directories.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Allow login _if all write permissions on user's home directory</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- <property name="group">relax_permissions0_radiobutton</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">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>
- <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">False</property>
- <property name="fill">True</property>
- </packing>
- </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">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="GtkVBox" id="vbox103">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkHBox" id="hbox151">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkButton" id="config_xserverbutton">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Configure _X Server...</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="security_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Security</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="users_tab_vbox">
- <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="fb_informationlabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Users in the Include list will appear in the face browser if enabled and will appear in the user drop-down lists for automatic and timed logins on the Security tab. Users in the Exclude list will not appear. MinimalUID setting in the Security tab will affect which users will be allowed to join Include list.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_FILL</property>
- <property name="wrap">True</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox125">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkCheckButton" id="fb_allusers">
- <property name="border_width">3</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Include all users from /etc/passwd (not for NIS)</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table22">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="fb_includelabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">I_nclude:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">fb_include_treeview</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="fb_excludelabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">E_xclude:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">fb_exclude_treeview</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow19">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="fb_include_treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow20">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
- <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
- <property name="shadow_type">GTK_SHADOW_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="fb_exclude_treeview">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">False</property>
- <property name="reorderable">False</property>
- <property name="enable_search">True</property>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox124">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkVBox" id="UsersButtonBox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="fb_toexclude">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
-
- <child>
- <widget class="GtkImage" id="image19">
- <property name="visible">True</property>
- <property name="stock">gtk-go-forward</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>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="fb_toinclude">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
-
- <child>
- <widget class="GtkImage" id="image20">
- <property name="visible">True</property>
- <property name="stock">gtk-go-back</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>
- </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">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox193">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="fb_includedelete">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-remove</property>
- <property name="use_stock">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- </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="GtkButton" id="fb_includeadd">
- <property name="visible">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="alignment22">
- <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="hbox198">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image21">
- <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="label294">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox194">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="fb_excludedelete">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment21">
- <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="hbox192">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image18">
- <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="label290">
- <property name="visible">True</property>
- <property name="label" translatable="yes">R_emove</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="fb_excludeadd">
- <property name="visible">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="alignment20">
- <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="hbox191">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image17">
- <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="label289">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_dd...</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</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="GtkFixed" id="fixed6">
- <property name="height_request">6</property>
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table36">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkFileChooserButton" id="default_face_filechooser">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="title" translatable="yes">Select Logo Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_OPEN</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkFileChooserButton" id="global_face_dir_filechooser">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="title" translatable="yes">Select Logo Image</property>
- <property name="action">GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER</property>
- <property name="local_only">True</property>
- <property name="show_hidden">False</property>
- <property name="do_overwrite_confirmation">False</property>
- <property name="width_chars">-1</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="global_face_dir_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Systemwide directory for face files. The sysadmin can place icons for users here without touching their homedirs. Faces are named after their users' logins. The face images must be stored in gdk-pixbuf supported formats and they must be readable for the GDM user.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Global face dir:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="default_face_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">If a user has no defined face image, GDM will use the &quot;stock_person&quot; icon defined in the current GTK+ theme. If no such image is defined, the image specified by DefaultFace will be used. The image must be in an gdk-pixbuf supported format and the file must be readable to the GDM user.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">De_fault face:</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></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>
-
- <child>
- <widget class="GtkHBox" id="hbox217">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="fb_faceapply">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment26">
- <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="hbox218">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image25">
- <property name="visible">True</property>
- <property name="stock">gtk-apply</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="label313">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_pply User Changes</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</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="tab_expand">False</property>
- <property name="tab_fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="users_tab_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Users</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="type">tab</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="xdmcp_dialog">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">XDMCP Login Window Preferences</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="modal">False</property>
- <property name="resizable">False</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="closebutton2">
- <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>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table16">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="n_rows">9</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkCheckButton" id="honour_indirect">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Enables XDMCP INDIRECT choosing (i.e. remote execution of gdmchooser) for X-terminals which don't supply their own display browser.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Honor _indirect requests</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label216">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Listen on _UDP port: </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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">udpport</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label217">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Maximum pending requests:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">maxpending</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label218">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Maximum p_ending indirect requests:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">maxpendingindirect</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label219">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Maximum _remote sessions:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">maxremotesessions</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label220">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Maximum _wait time:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">maxwait</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label221">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Maximum indirect w_ait time:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">maxwaitindirect</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label222">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Displays per _host:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">displaysperhost</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label223">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Ping interval:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">pinginterval</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="udpport">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The UDP port number gdm should listen to for XDMCP requests. Don't change this unless you know what you are doing.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 1 65536 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="maxpending">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">To avoid denial of service attacks, GDM has fixed size queue of pending connections. Please note that this parameter does *not* limit the number of remote displays which can be managed. It only limits the number of displays initiating a connection simultaneously.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">2 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="maxpendingindirect">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Number of simultaneously provided displays with host choosers. If more queries from different hosts come in, the oldest ones will be forgotten.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="maxremotesessions">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Determines the maximum number of remote display connections which will be managed simultaneously. I.e. the total number of remote displays that can use your host.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="maxwait">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">When GDM is ready to manage a display an ACCEPT packet is sent to it containing a unique session id which will be used in future XDMCP conversations. GDM will then place the session id in the pending queue waiting for the display to respond with a MANAGE request. If no response is received within maximum wait time, GDM will declare the display dead and erase it from the pending queue freeing up the slot for other displays.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="maxwaitindirect">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Determines the maximum number of seconds between the time where a user chooses a host and the subsequent indirect query where the user is connected to the host. When the timeout is exceeded, the information about the chosen host is forgotten and the indirect slot freed up for other displays.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="displaysperhost">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">To prevent attackers from filling up the pending queue, GDM will only allow one connection for each remote computer. If you want to provide display services to computers with more than one screen, you should increase the this value accordingly.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox135">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkSpinButton" id="pinginterval">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Interval in which to ping the X server in seconds. If the X server doesn't return before the next time we ping it, the connection is stopped and the session ended.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">15 0 6000 1 10 10</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label224">
- <property name="visible">True</property>
- <property name="label" translatable="yes">seconds</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</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>
-
-<widget class="GtkDialog" id="xserver_dialog">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">X Server Login Window Preferences</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</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="button1">
- <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="closebutton3">
- <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>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox110">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="xserver_informationlabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Warning:&lt;/b&gt; Incorrect settings could prevent the X server from restarting. Changes to these settings will not take effect until GDM is restarted.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">True</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox165">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkVBox" id="vbox117">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="server_to_start_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Servers To Start</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox175">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label268">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox112">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="vbox113">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow18">
- <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_IN</property>
- <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
- <child>
- <widget class="GtkTreeView" id="xserver_tree_view">
- <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>
- <property name="fixed_height_mode">False</property>
- <property name="hover_selection">False</property>
- <property name="hover_expand">False</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="GtkHBox" id="hbox195">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <placeholder/>
- </child>
-
- <child>
- <widget class="GtkButton" id="xserver_remove_button">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment14">
- <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="hbox179">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image11">
- <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="xserver_remove_buttonLabel">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="xserver_add_button">
- <property name="visible">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="alignment15">
- <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="hbox180">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image12">
- <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="xserver_add_buttonlabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Add/Modify...</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </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>
- </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>
- <packing>
- <property name="padding">0</property>
- <property name="expand">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox115">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkVBox" id="vbox126">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="label291">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox120">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">18</property>
-
- <child>
- <widget class="GtkHBox" id="hbox167">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label261">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Servers:</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">xserver_mod_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="xserver_mod_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes"></property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </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>
-
- <child>
- <widget class="GtkVBox" id="xserver_modify_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkLabel" id="server_settings_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Server Settings</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox176">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label269">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="vbox116">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table19">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label262">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Server _name:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_name_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="xserver_name_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The name that will be displayed to the user.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</property>
- <property name="visibility">True</property>
- <property name="max_length">256</property>
- <property name="text" translatable="yes"></property>
- <property name="has_frame">True</property>
- <property name="invisible_char">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label263">
- <property name="visible">True</property>
- <property name="label" translatable="yes">C_ommand:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_command_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="xserver_command_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">The command to execute, with full path to the binary of the X server, and any extra arguments needed. Example: /usr/X11R6/bin/X</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label272">
- <property name="visible">True</property>
- <property name="label" translatable="yes">La_unch:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_style_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="xserver_style_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes">Greeter
-Chooser</property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label302">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Priority:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserv_priority_spinbutton</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkSpinButton" id="xserv_priority_spinbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Indicates that the X server should be started at a different process priority.</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 -20 20 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></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="GtkCheckButton" id="xserver_handled_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">GDM should run the login window on this server and allow a user to log in. If not selected, then GDM will just run this server and wait for it to terminate.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Logins are handled by this computer</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="xserver_flexible_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">This server is available as a choice when a user wishes to run a flexible, on demand server.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">_Flexible (on demand)</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkTable" id="table20">
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label264">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Resolution:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label265">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Color depth:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label266">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Refresh rate:</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></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>
- <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>
- </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">False</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox196">
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="xserver_deletebutton">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment13">
- <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="hbox178">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image10">
- <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="label271">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Re_move Server</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="xserver_createbutton">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment16">
- <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="hbox185">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image13">
- <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="xserver_createbuttonlabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Add S_erver...</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </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>
- </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>
-
-<widget class="GtkDialog" id="add_xserver_dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Add / Modify Servers To Start</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="modal">False</property>
- <property name="resizable">False</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox4">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</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">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-ok</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">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox122">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="table21">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkSpinButton" id="xserver_spin_button">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="climb_rate">1</property>
- <property name="digits">0</property>
- <property name="numeric">True</property>
- <property name="update_policy">GTK_UPDATE_ALWAYS</property>
- <property name="snap_to_ticks">False</property>
- <property name="wrap">False</property>
- <property name="adjustment">1 0 100 1 10 10</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="xserver_server_combobox">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="items" translatable="yes"></property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="xserver_options_entry">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">True</property>
- <property name="width_chars">25</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label277">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_VT:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_spin_button</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label278">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Server:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_server_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label279">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Op_tions: </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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">xserver_options_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
-</widget>
-
-<widget class="GtkDialog" id="add_user_dialog">
- <property name="border_width">5</property>
- <property name="title" translatable="yes">Add User</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
- <property name="modal">False</property>
- <property name="resizable">False</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="cancelbutton2">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-cancel</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">-6</property>
- </widget>
- </child>
-
- <child>
- <widget class="GtkButton" id="okbutton3">
- <property name="visible">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="can_focus">True</property>
- <property name="label">gtk-add</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">-5</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox197">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="fb_addlabel">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_User:</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">fb_addentry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="fb_addentry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">True</property>
- </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>
-
-<widget class="GtkDialog" id="commands_dialog">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="title" translatable="yes">Reboot, Halt, Suspend and Custom Command Preferences</property>
- <property name="type">GTK_WINDOW_TOPLEVEL</property>
- <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</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="focus_on_map">True</property>
- <property name="urgency_hint">False</property>
- <property name="has_separator">False</property>
-
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox132">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">GTK_BUTTONBOX_END</property>
-
- <child>
- <widget class="GtkButton" id="button2">
- <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="command_exit_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>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">GTK_PACK_END</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox133">
- <property name="border_width">5</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">12</property>
-
- <child>
- <widget class="GtkHBox" id="hbox9915">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="custom_cmd_note_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; You can select different commands from the drop-down list, and modify them through relevant fields located below. To save changes press Apply Command Changes button.</property>
- <property name="use_underline">False</property>
- <property name="use_markup">True</property>
- <property name="justify">GTK_JUSTIFY_FILL</property>
- <property name="wrap">True</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="hbox9916">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkTable" id="table46">
- <property name="visible">True</property>
- <property name="n_rows">1</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label473">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Comma_nd type:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">cmd_type_combobox</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="command_status_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">(Enabled)</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkComboBox" id="cmd_type_combobox">
- <property name="visible">True</property>
- <property name="items" translatable="yes"></property>
- <property name="add_tearoffs">False</property>
- <property name="focus_on_click">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="vbox141">
- <property name="width_request">478</property>
- <property name="height_request">420</property>
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkVBox" id="hrs_command_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table47">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label475">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> _Path: </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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">hrs_cmd_path_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="hrs_command_add">
- <property name="visible">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="alignment53">
- <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="hbox9917">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image52">
- <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="label476">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9931">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label504">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="hrs_path_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Full path and arguments to the command to be executed</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="hrs_cmd_path_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Full path and arguments to command to be executed. If the value is missing, the command will not available.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkVBox" id="custom_command_vbox">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkTable" id="table48">
- <property name="visible">True</property>
- <property name="n_rows">10</property>
- <property name="n_columns">3</property>
- <property name="homogeneous">False</property>
- <property name="row_spacing">6</property>
- <property name="column_spacing">12</property>
-
- <child>
- <widget class="GtkLabel" id="label477">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> Pa_th:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">custom_cmd_path_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkButton" id="custom_command_add">
- <property name="visible">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="alignment54">
- <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="hbox9918">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image53">
- <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="label478">
- <property name="visible">True</property>
- <property name="label" translatable="yes">A_dd...</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="custom_cmd_path_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Full path and arguments to command to be executed. If the value is missing, the command will not available.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">0</property>
- <property name="bottom_attach">1</property>
- <property name="y_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label482">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> T_ooltip:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">custom_cmd_tooltip_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="custom_cmd_tooltip_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies the message that will be displayed on Custom Command tooltip entries.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label481">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> Messa_ge:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">custom_cmd_text_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="custom_cmd_text_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies the message that will be displayed on the warning dialog box when one of the Custom Command widgets is activated.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label480">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> LRla_bel:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">custom_cmd_lrlabel_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="custom_cmd_lrlabel_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies the label that will be displayed on the Custom Command list items and radio buttons.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkLabel" id="label479">
- <property name="visible">True</property>
- <property name="label" translatable="yes"> _Label:</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</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="mnemonic_widget">custom_cmd_label_entry</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="left_attach">0</property>
- <property name="right_attach">1</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">fill</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkEntry" id="custom_cmd_label_entry">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies the label that will be displayed on the Custom Command buttons and menu items.</property>
- <property name="can_focus">True</property>
- <property name="editable">True</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">•</property>
- <property name="activates_default">False</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9926">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label494">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="text_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Text to appear in the warning pop-up dialogs</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9927">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label496">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="tooltip_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Text to appear on the tooltips</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9928">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label498">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="lrlabel_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Text to appear on the radio buttons and list items</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9929">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label500">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="label_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Text to appear on the buttons and menu items</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">fill</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9930">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label502">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="custom_path_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Full path and arguments to the command to be executed</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="left_attach">0</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">fill</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="hbox9919">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label483">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="custom_cmd_persistent_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies if Custom Command will appear outside the login manager, for example on the desktop through the Log Out/Shut Down widgets.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">Per_sistent</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9924">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label490">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="persistent_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Accessible from the outside of the login manager</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9920">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label484">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- <packing>
- <property name="padding">0</property>
- <property name="expand">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkCheckButton" id="custom_cmd_norestart_checkbutton">
- <property name="visible">True</property>
- <property name="tooltip" translatable="yes">Specifies if gdm will be stopped/restarted once Custom Command has been executed.</property>
- <property name="can_focus">True</property>
- <property name="label" translatable="yes">No _restart required</property>
- <property name="use_underline">True</property>
- <property name="relief">GTK_RELIEF_NORMAL</property>
- <property name="focus_on_click">True</property>
- <property name="active">False</property>
- <property name="inconsistent">False</property>
- <property name="draw_indicator">True</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">True</property>
- <property name="fill">True</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9925">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">0</property>
-
- <child>
- <widget class="GtkLabel" id="label492">
- <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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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="norestart_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Don't restart the login manager after the execution</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>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">True</property>
- <property name="fill">True</property>
- </packing>
- </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">False</property>
- <property name="fill">False</property>
- </packing>
- </child>
-
- <child>
- <widget class="GtkHBox" id="hbox9921">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">6</property>
-
- <child>
- <widget class="GtkButton" id="command_apply_button">
- <property name="visible">True</property>
- <property name="sensitive">False</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="alignment55">
- <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="hbox9922">
- <property name="visible">True</property>
- <property name="homogeneous">False</property>
- <property name="spacing">2</property>
-
- <child>
- <widget class="GtkImage" id="image54">
- <property name="visible">True</property>
- <property name="stock">gtk-apply</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="label485">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Apply Co_mmand Changes</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="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">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">False</property>
- <property name="pack_type">GTK_PACK_END</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>
- </widget>
- </child>
-</widget>
-
-</glade-interface>
diff --git a/gui/gdmuser.c b/gui/gdmuser.c
deleted file mode 100644
index f85db2c4..00000000
--- a/gui/gdmuser.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDM - The GNOME Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 "config.h"
-#include <locale.h>
-#include <glib/gi18n.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <pwd.h>
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmuser.h"
-#include "gdmconfig.h"
-
-static time_t time_started;
-
-static GdmUser *
-gdm_user_alloc (const gchar *logname,
- uid_t uid,
- const gchar *homedir,
- const char *gecos,
- GdkPixbuf *defface,
- gboolean read_faces)
-{
- GdmUser *user;
- GdkPixbuf *img = NULL;
- gchar buf[PIPE_SIZE];
- size_t size;
- int bufsize;
- char *p;
-
- user = g_new0 (GdmUser, 1);
-
- user->uid = uid;
- user->login = g_strdup (logname);
- if (!g_utf8_validate (gecos, -1, NULL))
- user->gecos = ve_locale_to_utf8 (gecos);
- else
- user->gecos = g_strdup (gecos);
-
- /* Cut up to first comma since those are ugly arguments and
- * not the name anymore, but only if more then 1 comma is found,
- * since otherwise it might be part of the actual comment,
- * this is sort of "heurestic" because there seems to be no
- * real standard, it's all optional */
- p = strchr (user->gecos, ',');
- if (p != NULL) {
- if (strchr (p+1, ',') != NULL)
- *p = '\0';
- }
-
- user->homedir = g_strdup (homedir);
- if (defface != NULL)
- user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));
-
- if (ve_string_empty (logname))
- return user;
-
- /* don't read faces, since that requires the daemon */
- if (!read_faces)
- return user;
-
- /* read initial request */
- do {
- while (read (STDIN_FILENO, buf, 1) == 1)
- if (buf[0] == STX)
- break;
- size = read (STDIN_FILENO, buf, sizeof (buf));
- if (size <= 0)
- return user;
- } while (buf[0] != GDM_NEEDPIC);
-
- printf ("%c%s\n", STX, logname);
- fflush (stdout);
-
- do {
- while (read (STDIN_FILENO, buf, 1) == 1)
- if (buf[0] == STX)
- break;
- size = read (STDIN_FILENO, buf, sizeof (buf));
- if (size <= 0)
- return user;
- } while (buf[0] != GDM_READPIC);
-
- /* both nul terminate and wipe the trailing \n */
- buf[size-1] = '\0';
-
- if (size < 2) {
- img = NULL;
- } else if (sscanf (&buf[1], "buffer:%d", &bufsize) == 1) {
- unsigned char buffer[2048];
- int pos = 0;
- int n;
- GdkPixbufLoader *loader;
- /* we trust the daemon, even if it wanted to give us
- * bogus bufsize */
- /* the daemon will now print the buffer */
- printf ("%cOK\n", STX);
- fflush (stdout);
-
- while (read (STDIN_FILENO, buf, 1) == 1)
- if (buf[0] == STX)
- break;
-
- loader = gdk_pixbuf_loader_new ();
-
- while ((n = read (STDIN_FILENO, buffer,
- MIN (sizeof (buffer), bufsize-pos))) > 0) {
- gdk_pixbuf_loader_write (loader, buffer, n, NULL);
- pos += n;
- if (pos >= bufsize)
- break;
- }
-
- gdk_pixbuf_loader_close (loader, NULL);
-
- img = gdk_pixbuf_loader_get_pixbuf (loader);
- if (img != NULL)
- g_object_ref (G_OBJECT (img));
-
- g_object_unref (G_OBJECT (loader));
-
- /* read the "done" bit, but don't check */
- read (STDIN_FILENO, buf, sizeof (buf));
- } else if (g_access (&buf[1], R_OK) == 0) {
- img = gdm_common_get_face (&buf[1],
- NULL,
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH),
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT));
- } else {
- img = NULL;
- }
-
- /* the daemon is now free to go on */
- printf ("%c\n", STX);
- fflush (stdout);
-
- if (img != NULL) {
- if (user->picture != NULL)
- g_object_unref (G_OBJECT (user->picture));
-
- user->picture = img;
- }
-
- return user;
-}
-
-static gboolean
-gdm_check_exclude (struct passwd *pwent, char **excludes, gboolean is_local)
-{
- const char * const lockout_passes[] = { "!!", NULL };
- gint i;
-
- if ( ! gdm_config_get_bool (GDM_KEY_ALLOW_ROOT) && pwent->pw_uid == 0)
- return TRUE;
-
- if ( ! gdm_config_get_bool (GDM_KEY_ALLOW_REMOTE_ROOT) && ! is_local && pwent->pw_uid == 0)
- return TRUE;
-
- if (pwent->pw_uid < gdm_config_get_int (GDM_KEY_MINIMAL_UID))
- return TRUE;
-
- for (i=0 ; lockout_passes[i] != NULL ; i++) {
- if (strcmp (lockout_passes[i], pwent->pw_passwd) == 0) {
- return TRUE;
- }
- }
-
- if (excludes != NULL) {
- for (i=0 ; excludes[i] != NULL ; i++) {
- if (g_ascii_strcasecmp (excludes[i],
- pwent->pw_name) == 0) {
- return TRUE;
- }
- }
- }
-
- return FALSE;
-}
-
-static gboolean
-gdm_check_shell (const gchar *usersh)
-{
- gint found = 0;
- gchar *csh;
-
- setusershell ();
-
- while ((csh = getusershell ()) != NULL)
- if (! strcmp (csh, usersh))
- found = 1;
-
- endusershell ();
-
- return (found);
-}
-
-static gint
-gdm_sort_func (gpointer d1, gpointer d2)
-{
- GdmUser *a = d1;
- GdmUser *b = d2;
-
- if (!d1 || !d2)
- return (0);
-
- return (strcmp (a->login, b->login));
-}
-
-
-static gboolean
-setup_user (struct passwd *pwent,
- GList **users,
- GList **users_string,
- char **excludes,
- char *exclude_user,
- GdkPixbuf *defface,
- int *size_of_users,
- gboolean is_local,
- gboolean read_faces)
-{
- GdmUser *user;
- int cnt = 0;
-
- if (pwent->pw_shell &&
- gdm_check_shell (pwent->pw_shell) &&
- !gdm_check_exclude (pwent, excludes, is_local) &&
- (exclude_user == NULL ||
- strcmp (ve_sure_string (exclude_user), pwent->pw_name)) != 0) {
-
- user = gdm_user_alloc (pwent->pw_name,
- pwent->pw_uid,
- pwent->pw_dir,
- ve_sure_string (pwent->pw_gecos),
- defface, read_faces);
-
- if ((user) &&
- (! g_list_find_custom (*users, user, (GCompareFunc) gdm_sort_func))) {
- cnt++;
- *users = g_list_insert_sorted (*users, user,
- (GCompareFunc) gdm_sort_func);
- *users_string = g_list_prepend (*users_string, g_strdup (pwent->pw_name));
-
- if (user->picture != NULL) {
- *size_of_users +=
- gdk_pixbuf_get_height (user->picture) + 2;
- } else {
- *size_of_users += gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- }
- }
-
- if (cnt > 1000 || time_started + 5 <= time (NULL)) {
- *users = g_list_append (*users,
- g_strdup (_("Too many users to list here...")));
- *users_string = g_list_append (*users_string,
- g_strdup (_("Too many users to list here...")));
-
- return (FALSE);
- }
- }
- return (TRUE);
-}
-
-gboolean
-gdm_is_user_valid (const char *username)
-{
- return (NULL != getpwnam (username));
-}
-
-gint
-gdm_user_uid (const char *username)
-{
- struct passwd *pwent;
- pwent = getpwnam (username);
- if (pwent != NULL)
- return pwent->pw_uid;
-
- return -1;
-}
-
-const char *
-get_root_user (void)
-{
- static char *root_user = NULL;
- struct passwd *pwent;
-
- if (root_user != NULL)
- return root_user;
-
- pwent = getpwuid (0);
- if (pwent == NULL) /* huh? */
- root_user = g_strdup ("root");
- else
- root_user = g_strdup (pwent->pw_name);
- return root_user;
-}
-
-void
-gdm_users_init (GList **users,
- GList **users_string,
- char *exclude_user,
- GdkPixbuf *defface,
- int *size_of_users,
- gboolean is_local,
- gboolean read_faces)
-{
- struct passwd *pwent;
- char **includes;
- char **excludes;
- gboolean found_include = FALSE;
- int i;
-
- time_started = time (NULL);
-
- includes = g_strsplit (gdm_config_get_string (GDM_KEY_INCLUDE), ",", 0);
- for (i=0 ; includes != NULL && includes[i] != NULL ; i++) {
- g_strstrip (includes[i]);
- if (includes[i] != NULL)
- found_include = TRUE;
- }
-
- excludes = g_strsplit (gdm_config_get_string (GDM_KEY_EXCLUDE), ",", 0);
- for (i=0 ; excludes != NULL && excludes[i] != NULL ; i++)
- g_strstrip (excludes[i]);
-
- if (gdm_config_get_bool (GDM_KEY_INCLUDE_ALL) == TRUE) {
- setpwent ();
- pwent = getpwent ();
- while (pwent != NULL) {
-
- if (! setup_user (pwent, users, users_string, excludes,
- exclude_user, defface, size_of_users, is_local,
- read_faces))
- break;
-
- pwent = getpwent ();
- }
- endpwent ();
-
- } else if (found_include == TRUE) {
- for (i=0 ; includes != NULL && includes[i] != NULL ; i++) {
- pwent = getpwnam (includes[i]);
-
- if (pwent != NULL) {
- if (!setup_user (pwent, users, users_string, excludes,
- exclude_user, defface, size_of_users, is_local,
- read_faces))
- break;
-
- }
- }
- }
-
- g_strfreev (includes);
- g_strfreev (excludes);
-}
-
diff --git a/gui/gdmuser.h b/gui/gdmuser.h
deleted file mode 100644
index 38f3376b..00000000
--- a/gui/gdmuser.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2003 George Lebl
- * - Common routines for the greeters.
- *
- * 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 "misc.h"
-
-#ifndef GDM_USER_H
-#define GDM_USER_H
-
-typedef struct _GdmUser GdmUser;
-struct _GdmUser {
- uid_t uid;
- char *login;
- char *homedir;
- char *gecos;
- GdkPixbuf *picture;
-};
-
-gboolean gdm_is_user_valid (const char *username);
-gint gdm_user_uid (const char *username);
-const char *get_root_user (void);
-void gdm_users_init (GList **users, GList **users_string,
- char *exclude_user, GdkPixbuf *defface,
- int *size_of_users, gboolean is_local,
- gboolean read_faces);
-
-#endif /* GDM_USER_H */
diff --git a/gui/gdmwm.c b/gui/gdmwm.c
deleted file mode 100644
index d8530d34..00000000
--- a/gui/gdmwm.c
+++ /dev/null
@@ -1,1721 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2001 George Lebl
- *
- * 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 "config.h"
-
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xatom.h>
-#ifdef HAVE_XFREE_XINERAMA
-#include <X11/extensions/Xinerama.h>
-#elif HAVE_SOLARIS_XINERAMA
-#include <X11/extensions/xinerama.h>
-#endif
-#include <pwd.h>
-#include <unistd.h>
-
-#include "gdmwm.h"
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-
-typedef struct _GdmWindow GdmWindow;
-struct _GdmWindow {
- int x, y;
- Window win;
- Window deco;
- Window shadow;
- gboolean ignore_size_hints; /* for gdm windows */
- gboolean center; /* do centering */
- gboolean recenter; /* do re-centering */
- gboolean takefocus; /* permit take focus */
-
- /* hack, when we reparent, we will get an unmap and then
- * an map, and we want to ignore those */
- int ignore_next_map;
- int ignore_next_unmap;
-};
-
-static GList *windows = NULL;
-static gboolean focus_new_windows = FALSE;
-static int no_focus_login = 0;
-static Display *wm_disp = NULL;
-static Window wm_root = None;
-static Window wm_login_window = None;
-static Window wm_focus_window = None;
-
-static Atom XA_WM_PROTOCOLS = 0;
-static Atom XA_WM_STATE = 0;
-static Atom XA_WM_TAKE_FOCUS = 0;
-static Atom XA_COMPOUND_TEXT = 0;
-static Atom XA_NET_WM_STRUT = 0;
-
-static int trap_depth = 0;
-
-GdkRectangle *gdm_wm_allscreens = NULL;
-int gdm_wm_screens = 0;
-GdkRectangle gdm_wm_screen = {0,0,0,0};
-
-static Window strut_owners[4] = {None, None, None, None};
-static guint save_struts[4] = {0, 0, 0, 0};
-
-void
-gdm_wm_screen_init (int cur_screen_num)
-{
- if (g_getenv ("FAKE_XINERAMA_GDM") != NULL) {
- /* for testing Xinerama support on non-xinerama setups */
- gdm_wm_screen.x = 100;
- gdm_wm_screen.y = 100;
- gdm_wm_screen.width = gdk_screen_width () / 2 - 100;
- gdm_wm_screen.height = gdk_screen_height () / 2 - 100;
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, 2);
- gdm_wm_allscreens[0] = gdm_wm_screen;
- gdm_wm_allscreens[1].x = gdk_screen_width () / 2;
- gdm_wm_allscreens[1].y = gdk_screen_height () / 2;
- gdm_wm_allscreens[1].width = gdk_screen_width () / 2;
- gdm_wm_allscreens[1].height = gdk_screen_height () / 2;
- gdm_wm_screens = 2;
- return;
- }
-
- {
-#ifdef HAVE_XFREE_XINERAMA
- gboolean have_xinerama = FALSE;
-
- gdk_flush ();
- gdk_error_trap_push ();
- have_xinerama = XineramaIsActive (GDK_DISPLAY ());
- gdk_flush ();
- if (gdk_error_trap_pop () != 0)
- have_xinerama = FALSE;
-
- if (have_xinerama) {
- int screen_num, i;
- XineramaScreenInfo *xscreens =
- XineramaQueryScreens (GDK_DISPLAY (),
- &screen_num);
-
-
- if (screen_num <= 0) {
- /* should NEVER EVER happen */
- gdm_common_error ("Xinerama active, but <= 0 screens?");
- gdm_wm_screen.x = 0;
- gdm_wm_screen.y = 0;
- gdm_wm_screen.width = gdk_screen_width ();
- gdm_wm_screen.height = gdk_screen_height ();
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, 1);
- gdm_wm_allscreens[0] = gdm_wm_screen;
- gdm_wm_screens = 1;
- return;
- }
-
- if (screen_num <= cur_screen_num)
- cur_screen_num = 0;
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, screen_num);
- gdm_wm_screens = screen_num;
-
- for (i = 0; i < screen_num; i++) {
- gdm_wm_allscreens[i].x = xscreens[i].x_org;
- gdm_wm_allscreens[i].y = xscreens[i].y_org;
- gdm_wm_allscreens[i].width = xscreens[i].width;
- gdm_wm_allscreens[i].height = xscreens[i].height;
-
- if (cur_screen_num == i)
- gdm_wm_screen = gdm_wm_allscreens[i];
- }
-
- XFree (xscreens);
- } else
-#elif HAVE_SOLARIS_XINERAMA
- gboolean have_xinerama = FALSE;
- /* This code from GDK, Copyright (C) 2002 Sun Microsystems */
- int opcode;
- int firstevent;
- int firsterror;
- int n_monitors = 0;
-
- gdk_flush ();
- gdk_error_trap_push ();
- have_xinerama = XQueryExtension (GDK_DISPLAY (),
- "XINERAMA",
- &opcode,
- &firstevent,
- &firsterror);
- gdk_flush ();
- if (gdk_error_trap_pop () != 0)
- have_xinerama = FALSE;
-
- if (have_xinerama) {
- int i;
- int result;
- XRectangle monitors[MAXFRAMEBUFFERS];
- unsigned char hints[16];
-
- result = XineramaGetInfo (GDK_DISPLAY (), 0, monitors, hints, &n_monitors);
- /* Yes I know it should be Success but the current implementation
- * returns the num of monitor
- */
-
- if (result <= 0) {
- /* should NEVER EVER happen */
- gdm_common_error ("Xinerama active, but <= 0 screens?");
- gdm_wm_screen.x = 0;
- gdm_wm_screen.y = 0;
- gdm_wm_screen.width = gdk_screen_width ();
- gdm_wm_screen.height = gdk_screen_height ();
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, 1);
- gdm_wm_allscreens[0] = gdm_wm_screen;
- gdm_wm_screens = 1;
- return;
- }
-
- if (n_monitors <= cur_screen_num)
- cur_screen_num = 0;
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, n_monitors);
- gdm_wm_screens = n_monitors;
-
- for (i = 0; i < n_monitors; i++) {
- gdm_wm_allscreens[i].x = monitors[i].x;
- gdm_wm_allscreens[i].y = monitors[i].y;
- gdm_wm_allscreens[i].width = monitors[i].width;
- gdm_wm_allscreens[i].height = monitors[i].height;
-
- if (cur_screen_num == i)
- gdm_wm_screen = gdm_wm_allscreens[i];
- }
-
- } else
-#endif
- {
- gdm_wm_screen.x = 0;
- gdm_wm_screen.y = 0;
- gdm_wm_screen.width = gdk_screen_width ();
- gdm_wm_screen.height = gdk_screen_height ();
-
- gdm_wm_allscreens = g_new0 (GdkRectangle, 1);
- gdm_wm_allscreens[0] = gdm_wm_screen;
- gdm_wm_screens = 1;
- }
- }
-}
-
-void
-gdm_wm_set_screen (int cur_screen_num)
-{
- if (cur_screen_num >= gdm_wm_screens || cur_screen_num < 0)
- cur_screen_num = 0;
-
- gdm_wm_screen = gdm_wm_allscreens[cur_screen_num];
-}
-
-/* Not really a WM function, center a gtk window by setting uposition */
-void
-gdm_wm_center_window (GtkWindow *cw)
-{
- gint x, y;
- gint w, h;
-
- gtk_window_get_size (cw, &w, &h);
-
- x = gdm_wm_screen.x + (gdm_wm_screen.width - w)/2;
- y = gdm_wm_screen.y + (gdm_wm_screen.height - h)/2;
-
- if (x < gdm_wm_screen.x)
- x = gdm_wm_screen.x;
- if (y < gdm_wm_screen.y)
- y = gdm_wm_screen.y;
-
- gtk_window_move (GTK_WINDOW (cw), x, y);
-}
-
-void
-gdm_wm_center_cursor (void)
-{
- XWarpPointer (wm_disp, None, wm_root, 0, 0, 0, 0,
- gdm_wm_screen.x + gdm_wm_screen.width / 2,
- gdm_wm_screen.y + gdm_wm_screen.height / 2);
-}
-
-static void
-trap_push (void)
-{
- trap_depth++;
- gdk_error_trap_push ();
-}
-
-static int
-trap_pop (void)
-{
- trap_depth --;
- if (trap_depth <= 0)
- XSync (wm_disp, False);
- return gdk_error_trap_pop ();
-}
-
-/* stolen from gwmh */
-static gpointer
-get_typed_property_data (Display *xdisplay,
- Window xwindow,
- Atom property,
- Atom requested_type,
- gint *size_p,
- guint expected_format)
-{
- static const guint prop_buffer_lengh = 1024 * 1024;
- unsigned char *prop_data = NULL;
- Atom type_returned = 0;
- unsigned long nitems_return = 0, bytes_after_return = 0;
- int format_returned = 0;
- gpointer data = NULL;
- gboolean abort = FALSE;
-
- g_return_val_if_fail (size_p != NULL, NULL);
- *size_p = 0;
-
- gdk_error_trap_push ();
-
- abort = XGetWindowProperty (xdisplay,
- xwindow,
- property,
- 0, prop_buffer_lengh,
- False,
- requested_type,
- &type_returned, &format_returned,
- &nitems_return,
- &bytes_after_return,
- &prop_data) != Success;
- if (gdk_error_trap_pop () ||
- type_returned == None)
- abort++;
- if (!abort &&
- requested_type != AnyPropertyType &&
- requested_type != type_returned)
- {
- /* aparently this can happen for some properties of broken apps, be silent */
- abort++;
- }
- if (!abort && bytes_after_return)
- {
- g_warning (G_GNUC_PRETTY_FUNCTION "(): Eeek, property has more than %u bytes, stored on harddisk?",
- prop_buffer_lengh);
- abort++;
- }
- if (!abort && expected_format && expected_format != format_returned)
- {
- g_warning (G_GNUC_PRETTY_FUNCTION "(): Expected format (%u) unmatched (%d)",
- expected_format, format_returned);
- abort++;
- }
- if (!abort && prop_data && nitems_return && format_returned)
- {
- switch (format_returned)
- {
- case 32:
- *size_p = nitems_return * 4;
- if (sizeof (gulong) == 8)
- {
- guint32 i, *mem = g_malloc0 (*size_p + 1);
- gulong *prop_longs = (gulong*) prop_data;
-
- for (i = 0; i < *size_p / 4; i++)
- mem[i] = prop_longs[i];
- data = mem;
- }
- break;
- case 16:
- *size_p = nitems_return * 2;
- break;
- case 8:
- *size_p = nitems_return;
- break;
- default:
- g_warning ("Unknown property data format with %d bits (extraterrestrial?)",
- format_returned);
- break;
- }
- if (!data && *size_p)
- {
- guint8 *mem = NULL;
-
- if (format_returned == 8 && type_returned == XA_COMPOUND_TEXT)
- {
- gchar **tlist = NULL;
- gint count = gdk_text_property_to_text_list
- (gdk_x11_xatom_to_atom (type_returned), 8, prop_data,
- nitems_return, &tlist);
-
- if (count && tlist && tlist[0])
- {
- mem = (guint8 *)g_strdup (tlist[0]);
- *size_p = strlen ((char *)mem);
- }
- if (tlist)
- gdk_free_text_list (tlist);
- }
- if (!mem)
- {
- mem = g_malloc (*size_p + 1);
- memcpy (mem, prop_data, *size_p);
- mem[*size_p] = 0;
- }
- data = mem;
- }
- }
-
- if (prop_data)
- XFree (prop_data);
-
- return data;
-}
-
-/*
- * Update the gdm_wm_screen 'effective' screen area when a window reserves struts.
- * This only works if struts don't "collide", i.e. there is a max of one strut setter
- * per edge. Of course this should be the case at gdm time...
- */
-static void
-gdm_wm_update_struts (Display *xdisplay, Window xwindow)
-{
- gint size = 0;
- guint32 *struts = get_typed_property_data (xdisplay, xwindow, XA_NET_WM_STRUT,
- XA_CARDINAL, &size, 32);
- if (size == 16)
- {
- gint i;
- for (i = 0; i < 4; ++i)
- {
- /* strut owners are the only windows whose 'zero' struts are reflected */
- if (struts[i] != 0 || (strut_owners[i] == xwindow))
- {
- /* if any window re-specifies a strut, it becomes the new owner */
- strut_owners[i] = xwindow;
- save_struts[i] = struts[i];
- }
- }
- }
- g_free (struts);
-}
-
-/* stolen from gwmh */
-static gboolean
-wm_protocol_check_support (Window xwin,
- Atom check_atom)
-{
- Atom *pdata = NULL;
- guint32 *gdata = NULL;
- int n_pids = 0;
- gboolean is_supported = FALSE;
- guint i, n_gids = 0;
-
- trap_push ();
-
- if (!XGetWMProtocols (wm_disp,
- xwin,
- &pdata,
- &n_pids))
- {
- gint size = 0;
-
- gdata = get_typed_property_data (wm_disp,
- xwin,
- XA_WM_PROTOCOLS,
- XA_WM_PROTOCOLS,
- &size, 32);
- n_gids = size / 4;
- }
-
- trap_pop ();
-
- for (i = 0; i < n_pids; i++)
- if (pdata[i] == check_atom)
- {
- is_supported = TRUE;
- break;
- }
- if (pdata)
- XFree (pdata);
- if (!is_supported)
- for (i = 0; i < n_gids; i++)
- if (gdata[i] == check_atom)
- {
- is_supported = TRUE;
- break;
- }
- g_free (gdata);
-
- return is_supported;
-}
-
-static GList *
-find_window_list (Window w, gboolean deco_ok)
-{
- GList *li;
-
- for (li = windows; li != NULL; li = li->next) {
- GdmWindow *gw = li->data;
-
- if (gw->win == w)
- return li;
- if (deco_ok &&
- (gw->deco == w ||
- gw->shadow == w))
- return li;
- }
-
- return NULL;
-}
-
-static GdmWindow *
-find_window (Window w, gboolean deco_ok)
-{
- GList *li = find_window_list (w, deco_ok);
- if (li == NULL)
- return NULL;
- else
- return li->data;
-}
-
-void
-gdm_wm_focus_window (Window window)
-{
- XWindowAttributes attribs = {0};
- GdmWindow *win;
-
- if (no_focus_login > 0 &&
- window == wm_login_window)
- return;
-
- win = find_window (window, TRUE);
- if (win != NULL &&
- ! win->takefocus)
- return;
-
- trap_push ();
-
- XGetWindowAttributes (wm_disp, window, &attribs);
- if (attribs.map_state == IsUnmapped) {
- trap_pop ();
- return;
- }
-
- if (wm_protocol_check_support (window, XA_WM_TAKE_FOCUS)) {
- XEvent xevent = { 0, };
-
- xevent.type = ClientMessage;
- xevent.xclient.window = window;
- xevent.xclient.message_type = XA_WM_PROTOCOLS;
- xevent.xclient.format = 32;
- xevent.xclient.data.l[0] = XA_WM_TAKE_FOCUS;
- xevent.xclient.data.l[1] = CurrentTime;
-
- XSendEvent (wm_disp, window, False, 0, &xevent);
- XSync (wm_disp, False);
- }
-
- XSetInputFocus (wm_disp,
- window,
- RevertToPointerRoot,
- CurrentTime);
- trap_pop ();
-
- wm_focus_window = window;
-}
-
-static void
-constrain_window (GdmWindow *gw)
-{
-/* constrain window to lie within screen geometry, with struts reserved */
- int x, y, screen_x = 0, screen_y = 0;
- Window root;
- unsigned int width, height, border, depth;
- unsigned int screen_width = gdk_screen_width (), screen_height = gdk_screen_height ();
-
- /* exclude any strut areas not owned by this window */
- if (strut_owners[0] != gw->win)
- {
- screen_x = save_struts[0];
- screen_width -= save_struts[0];
- }
- if (strut_owners[2] != gw->win)
- {
- screen_y = save_struts[2];
- screen_height -= save_struts[2];
- }
- if (strut_owners[1] != gw->win)
- screen_width -= save_struts[1];
- if (strut_owners[3] != gw->win)
- screen_height -= save_struts[3];
-
- if (gw->deco == None)
- return;
-
- trap_push ();
-
- XGetGeometry (wm_disp, gw->deco,
- &root, &x, &y, &width, &height, &border, &depth);
-
- if (width > screen_width)
- width = screen_width;
- if (height > screen_height)
- height = screen_height;
-
- if (x < screen_x)
- x = screen_x;
- if (y < screen_y)
- y = screen_y;
- if ((x - screen_x + width) > screen_width)
- x = screen_width - width;
- if ((y - screen_y + height) > screen_height)
- y = screen_height - height;
-
- XMoveResizeWindow (wm_disp, gw->deco, x, y, width, height);
-
- trap_pop ();
-}
-
-static void
-constrain_all_windows (void)
-{
- GList *winlist = windows;
-
- while (winlist)
- {
- GdmWindow *gw = winlist->data;
- constrain_window (gw);
- winlist = winlist->next;
- }
-}
-
-static void
-center_x_window (GdmWindow *gw, Window w, Window hintwin)
-{
- XSizeHints hints;
- Status status;
- long ret;
- int x, y;
- Window root;
- unsigned int width, height, border, depth;
- gboolean can_resize, can_reposition;
-
- trap_push ();
-
- status = XGetWMNormalHints (wm_disp,
- hintwin,
- &hints,
- &ret);
-
- if ( ! status) {
- trap_pop ();
- return;
- }
-
- /* allow resizing when PSize is given, just don't allow centering when
- * PPosition is goven */
- can_resize = ! (hints.flags & USSize);
- can_reposition = ! (hints.flags & USPosition ||
- hints.flags & PPosition);
-
- if (can_reposition && ! gw->center)
- can_reposition = FALSE;
-
- if (gw->ignore_size_hints) {
- can_resize = TRUE;
- can_reposition = TRUE;
- }
-
- if ( ! can_resize &&
- ! can_reposition) {
- trap_pop ();
- return;
- }
-
- XGetGeometry (wm_disp, w,
- &root, &x, &y, &width, &height, &border, &depth);
-
- /* we replace the x,y and width,height with some new values */
-
- if (can_resize) {
- if (width > gdm_wm_screen.width)
- width = gdm_wm_screen.width;
- if (height > gdm_wm_screen.height)
- height = gdm_wm_screen.height;
- }
-
- if (can_reposition) {
- /* we wipe the X with some new values */
- x = gdm_wm_screen.x + (gdm_wm_screen.width - width)/2;
- y = gdm_wm_screen.y + (gdm_wm_screen.height - height)/2;
-
- if (x < gdm_wm_screen.x)
- x = gdm_wm_screen.x;
- if (y < gdm_wm_screen.y)
- y = gdm_wm_screen.y;
- }
-
- XMoveResizeWindow (wm_disp, w, x, y, width, height);
-
- if (gw->center && ! gw->recenter) {
- gw->center = FALSE;
- }
-
- trap_pop ();
-}
-
-#ifndef MWMUTIL_H_INCLUDED
-
-typedef struct {
- unsigned long flags;
- unsigned long functions;
- unsigned long decorations;
- long input_mode;
- unsigned long status;
-} MotifWmHints, MwmHints;
-
-#define MWM_HINTS_DECORATIONS (1L << 1)
-
-#define MWM_DECOR_BORDER (1L << 1)
-
-#endif /* MWMUTIL_H_INCLUDED */
-
-static gboolean
-has_deco (Window win)
-{
- static Atom hints_atom = None;
- unsigned char *foo;
- MotifWmHints *hints;
- Atom type;
- gint format;
- gulong nitems;
- gulong bytes_after;
- gboolean border = TRUE;
-
- trap_push ();
-
- if (hints_atom == None)
- hints_atom = XInternAtom (wm_disp, "_MOTIF_WM_HINTS", False);
-
- hints = NULL;
-
- XGetWindowProperty (wm_disp, win,
- hints_atom, 0,
- sizeof (MotifWmHints) / sizeof (long),
- False, AnyPropertyType, &type, &format, &nitems,
- &bytes_after, &foo);
- hints = (MotifWmHints *)foo;
-
- if (type != None &&
- hints != NULL &&
- hints->flags & MWM_HINTS_DECORATIONS &&
- ! (hints->decorations & MWM_DECOR_BORDER)) {
- border = FALSE;
- }
-
- if (hints != NULL)
- XFree (hints);
-
- trap_pop ();
-
- return border;
-}
-
-
-static void
-add_deco (GdmWindow *w, gboolean is_mapped)
-{
- int x, y;
- Window root;
- unsigned int width, height, border, depth;
- XWindowAttributes attribs = { 0, };
- int black;
-
- trap_push ();
-
- XGetWindowAttributes (wm_disp, w->win, &attribs);
- XSelectInput (wm_disp, w->win,
- attribs.your_event_mask |
- PropertyChangeMask);
-
- if ( ! has_deco (w->win)) {
- trap_pop ();
- return;
- }
-
- XGetGeometry (wm_disp, w->win,
- &root, &x, &y, &width, &height, &border, &depth);
-
- black = BlackPixel (wm_disp, DefaultScreen (wm_disp));
-
- /* all but the login window has shadows */
- if (w->win != wm_login_window) {
- w->shadow = XCreateSimpleWindow (wm_disp,
- wm_root,
- x + 4, y + 4,
- width + 2 + 2 * border,
- height + 2 + 2 * border,
- 0,
- black, black);
-
- XMapWindow (wm_disp, w->shadow);
- }
-
- w->deco = XCreateSimpleWindow (wm_disp,
- wm_root,
- x - 1, y - 1,
- width + 2 + 2 * border,
- height + 2 + 2 * border,
- 0,
- black, black);
-
- XGetWindowAttributes (wm_disp, w->deco, &attribs);
- XSelectInput (wm_disp, w->deco,
- attribs.your_event_mask |
- EnterWindowMask |
- PropertyChangeMask |
- SubstructureNotifyMask |
- SubstructureRedirectMask);
-
- XMapWindow (wm_disp, w->deco);
-
- XSync (wm_disp, False);
- trap_pop ();
-
- trap_push ();
- XReparentWindow (wm_disp, w->win, w->deco, 1, 1);
- XSync (wm_disp, False);
- if (trap_pop () == 0) {
- if (is_mapped) {
- /* Ignore the next unmap/map, but only
- * if reparent window really succeeded */
- w->ignore_next_map++;
- w->ignore_next_unmap++;
- }
- }
-}
-
-static gboolean
-is_wm_class (XClassHint *hint, const char *string, int len)
-{
- if (len > 0) {
- return ((hint->res_name != NULL &&
- strncmp (hint->res_name, string, len) == 0) ||
- (hint->res_class != NULL &&
- strncmp (hint->res_class, string, len) == 0));
- } else {
- return ((hint->res_name != NULL &&
- strcmp (hint->res_name, string) == 0) ||
- (hint->res_class != NULL &&
- strcmp (hint->res_class, string) == 0));
- }
-}
-
-static GdmWindow *
-add_window (Window w, gboolean center, gboolean is_mapped)
-{
- GdmWindow *gw;
-
- gw = find_window (w, FALSE);
- if (gw == NULL) {
- XClassHint hint = { NULL, NULL };
- XWMHints *wmhints;
- int x, y;
- Window root;
- unsigned int width, height, border, depth;
-
- gw = g_new0 (GdmWindow, 1);
- gw->win = w;
- windows = g_list_prepend (windows, gw);
-
- trap_push ();
-
- /* add "centering" */
- gw->ignore_size_hints = FALSE;
- gw->center = center;
- gw->recenter = FALSE;
- gw->takefocus = TRUE;
-
- gw->ignore_next_map = 0;
- gw->ignore_next_unmap = 0;
-
- wmhints = XGetWMHints (wm_disp, w);
- if (wmhints != NULL) {
- /* NoInput windows */
- if ((wmhints->flags & InputHint) &&
- ! wmhints->input) {
- gw->takefocus = FALSE;
- }
- XFree (wmhints);
- }
-
- /* hack, set USpos/size on login window */
- if (w == wm_login_window) {
- long ret;
- XSizeHints hints;
- XGetWMNormalHints (wm_disp, w, &hints, &ret);
- hints.flags |= USPosition | USSize;
- XSetWMNormalHints (wm_disp, w, &hints);
- gw->center = FALSE;
- gw->recenter = FALSE;
- } else if (XGetClassHint (wm_disp, w, &hint)) {
- if (is_wm_class (&hint, "gdm", 3)) {
- gw->ignore_size_hints = TRUE;
- gw->center = TRUE;
- gw->recenter = TRUE;
- } else if (is_wm_class (&hint, "gkrellm", 0)) {
- /* hack, gkrell is stupid and doesn't set
- * right hints, such as USPosition and other
- * such stuff */
- gw->center = FALSE;
- gw->recenter = FALSE;
- } else if (is_wm_class (&hint, "xscribble", 0)) {
- /* hack, xscribble mustn't take focus */
- gw->takefocus = FALSE;
- }
- if (hint.res_name != NULL)
- XFree (hint.res_name);
- if (hint.res_class != NULL)
- XFree (hint.res_class);
- }
-
- XGetGeometry (wm_disp, w,
- &root, &x, &y, &width, &height, &border, &depth);
-
- gw->x = x;
- gw->y = x;
-
- center_x_window (gw, w, w);
- add_deco (gw, is_mapped);
-
- XAddToSaveSet (wm_disp, w);
-
- trap_pop ();
- }
- return gw;
-}
-
-static void
-remove_window (Window w)
-{
- GList *li = find_window_list (w, FALSE);
-
- if (w == wm_focus_window)
- wm_focus_window = None;
-
- if (li != NULL) {
- GdmWindow *gw = li->data;
-
- li->data = NULL;
-
- trap_push ();
-
- XRemoveFromSaveSet (wm_disp, w);
-
- gw->win = None;
-
- if (gw->deco != None) {
- XDestroyWindow (wm_disp, gw->deco);
- gw->deco = None;
- }
- if (gw->shadow != None) {
- XDestroyWindow (wm_disp, gw->shadow);
- gw->shadow = None;
- }
- trap_pop ();
-
- windows = g_list_remove_link (windows, li);
- g_list_free_1 (li);
-
- g_free (gw);
- }
-}
-
-static void
-revert_focus_to_login (void)
-{
- if (wm_login_window != None) {
- gdm_wm_focus_window (wm_login_window);
- }
-}
-
-static void
-add_all_current_windows (void)
-{
- Window *children = NULL;
- Window xparent, xroot;
- guint size = 0;
-
- gdk_flush ();
- XSync (wm_disp, False);
- trap_push ();
-
- XGrabServer (wm_disp);
-
- if (XQueryTree (wm_disp,
- wm_root,
- &xroot,
- &xparent,
- &children,
- &size)) {
- int i;
-
- for (i = 0; i < size; i++) {
- XWindowAttributes attribs = {0};
-
- XGetWindowAttributes (wm_disp,
- children[i],
- &attribs);
-
- if ( ! attribs.override_redirect &&
- attribs.map_state != IsUnmapped) {
- add_window (children[i],
- FALSE /*center*/,
- TRUE /* is_mapped */);
- }
- }
-
- if (children != NULL)
- XFree (children);
- }
-
- XUngrabServer (wm_disp);
-
- trap_pop ();
-}
-
-static void
-reparent_to_root (GdmWindow *gw)
-{
- /* only if reparented */
- if (gw->deco != None) {
- trap_push ();
-
- XReparentWindow (wm_disp, gw->win, wm_root, gw->x, gw->y);
- XSync (wm_disp, False);
-
- trap_pop ();
- }
-}
-
-static void
-shadow_follow (GdmWindow *gw)
-{
- int x, y;
- Window root;
- unsigned int width, height, border, depth;
-
- if (gw->shadow == None)
- return;
-
- trap_push ();
-
- XGetGeometry (wm_disp, gw->deco,
- &root, &x, &y, &width, &height, &border, &depth);
-
- x += 5;
- y += 5;
-
- XMoveResizeWindow (wm_disp, gw->shadow, x, y, width, height);
-
- trap_pop ();
-}
-
-static void
-event_process (XEvent *ev)
-{
- GdmWindow *gw;
- Window w;
- XWindowChanges wchanges;
-
- trap_push ();
-
- switch (ev->type) {
- case MapRequest:
- w = ev->xmaprequest.window;
- gw = find_window (w, FALSE);
- if (gw == NULL) {
- if (ev->xmaprequest.parent == wm_root) {
- XGrabServer (wm_disp);
- gw = add_window (w,
- TRUE /* center */,
- FALSE /* is_mapped */);
- XUngrabServer (wm_disp);
- }
- }
- XMapWindow (wm_disp, w);
- break;
- case ConfigureRequest:
- XGrabServer (wm_disp);
- w = ev->xconfigurerequest.window;
- gw = find_window (w, FALSE);
- wchanges.border_width = ev->xconfigurerequest.border_width;
- wchanges.sibling = ev->xconfigurerequest.above;
- wchanges.stack_mode = ev->xconfigurerequest.detail;
- if (gw == NULL ||
- gw->deco == None) {
- wchanges.x = ev->xconfigurerequest.x;
- wchanges.y = ev->xconfigurerequest.y;
- } else {
- wchanges.x = 1;
- wchanges.y = 1;
- }
- wchanges.width = ev->xconfigurerequest.width;
- wchanges.height = ev->xconfigurerequest.height;
- XConfigureWindow (wm_disp,
- w,
- ev->xconfigurerequest.value_mask,
- &wchanges);
- if (gw != NULL) {
- gw->x = ev->xconfigurerequest.x;
- gw->y = ev->xconfigurerequest.y;
- if (gw->deco != None) {
- wchanges.x = ev->xconfigurerequest.x - 1;
- wchanges.y = ev->xconfigurerequest.y - 1;
- wchanges.width = ev->xconfigurerequest.width + 2
- + 2*ev->xconfigurerequest.border_width;;
- wchanges.height = ev->xconfigurerequest.height + 2
- + 2*ev->xconfigurerequest.border_width;;
- wchanges.border_width = 0;
- XConfigureWindow (wm_disp,
- gw->deco,
- ev->xconfigurerequest.value_mask,
- &wchanges);
- center_x_window (gw, gw->deco, gw->win);
- } else {
- center_x_window (gw, gw->win, gw->win);
- }
- shadow_follow (gw);
- }
- XUngrabServer (wm_disp);
- break;
- case CirculateRequest:
- w = ev->xcirculaterequest.window;
- gw = find_window (w, FALSE);
- if (gw == NULL) {
- if (ev->xcirculaterequest.place == PlaceOnTop)
- XRaiseWindow (wm_disp, w);
- else
- XLowerWindow (wm_disp, w);
- } else {
- if (ev->xcirculaterequest.place == PlaceOnTop) {
- if (gw->shadow != None)
- XRaiseWindow (wm_disp, gw->shadow);
- if (gw->deco != None)
- XRaiseWindow (wm_disp, gw->deco);
- else
- XRaiseWindow (wm_disp, gw->win);
- } else {
- if (gw->deco != None)
- XLowerWindow (wm_disp, gw->deco);
- else
- XLowerWindow (wm_disp, gw->win);
- if (gw->shadow != None)
- XLowerWindow (wm_disp, gw->shadow);
- }
- }
- break;
- case MapNotify:
- w = ev->xmap.window;
- gw = find_window (w, FALSE);
- if (gw != NULL) {
- if (gw->ignore_next_map > 0) {
- gw->ignore_next_map --;
- break;
- }
- if ( ! ev->xmap.override_redirect &&
- focus_new_windows) {
- gdm_wm_focus_window (w);
- }
- }
- break;
- case UnmapNotify:
- w = ev->xunmap.window;
- gw = find_window (w, FALSE);
- if (gw != NULL) {
- if (gw->ignore_next_unmap > 0) {
- gw->ignore_next_unmap --;
- break;
- }
- XGrabServer (wm_disp);
- if (gw->deco != None)
- XUnmapWindow (wm_disp, gw->deco);
- if (gw->shadow != None)
- XUnmapWindow (wm_disp, gw->shadow);
- reparent_to_root (gw);
- remove_window (w);
- XDeleteProperty (wm_disp, w, XA_WM_STATE);
- if (w != wm_login_window)
- revert_focus_to_login ();
- XUngrabServer (wm_disp);
- }
- break;
- case DestroyNotify:
- w = ev->xdestroywindow.window;
- gw = find_window (w, FALSE);
- if (gw != NULL) {
- XGrabServer (wm_disp);
- remove_window (w);
- if (w != wm_login_window)
- revert_focus_to_login ();
- XUngrabServer (wm_disp);
- }
- break;
- case EnterNotify:
- w = ev->xcrossing.window;
- gw = find_window (w, TRUE);
- if (gw != NULL)
- gdm_wm_focus_window (gw->win);
- break;
- case PropertyNotify:
- if (ev->xproperty.atom == XA_NET_WM_STRUT)
- {
- gdm_wm_update_struts (ev->xproperty.display,
- ev->xproperty.window);
- constrain_all_windows ();
- }
- break;
- default:
- break;
- }
-
- trap_pop ();
-}
-
-/* following partly stolen from gdk */
-static GPollFD event_poll_fd;
-
-static gboolean
-event_prepare (GSource *source,
- gint *timeout)
-{
- *timeout = -1;
- return XPending (wm_disp) > 0;
-}
-
-static gboolean
-event_check (GSource *source)
-{
- if (event_poll_fd.revents & G_IO_IN) {
- return XPending (wm_disp) > 0;
- } else {
- return FALSE;
- }
-}
-
-static void
-process_events (void)
-{
- while (XPending (wm_disp) > 0) {
- XEvent ev;
- XNextEvent (wm_disp, &ev);
- event_process (&ev);
- }
-}
-
-static gboolean
-event_dispatch (GSource *source,
- GSourceFunc callback,
- gpointer user_data)
-{
- process_events ();
-
- return TRUE;
-}
-
-static GSourceFuncs event_funcs = {
- event_prepare,
- event_check,
- event_dispatch
-};
-
-void
-gdm_wm_init (Window login_window)
-{
- XWindowAttributes attribs = { 0, };
- GSource *source;
-
- wm_login_window = login_window;
-
- if (wm_disp != NULL) {
- return;
- }
-
- wm_disp = XOpenDisplay (gdk_get_display ());
- if (wm_disp == NULL) {
- /* EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEK! */
- wm_disp = GDK_DISPLAY ();
- return;
- }
-
- trap_push ();
-
- XA_WM_PROTOCOLS = XInternAtom (wm_disp, "WM_PROTOCOLS", False);
- XA_WM_STATE = XInternAtom (wm_disp, "WM_STATE", False);
- XA_WM_TAKE_FOCUS = XInternAtom (wm_disp, "WM_TAKE_FOCUS", False);
-
- XA_COMPOUND_TEXT = XInternAtom (wm_disp, "COMPOUND_TEXT", False);
- XA_NET_WM_STRUT = XInternAtom (wm_disp, "_NET_WM_STRUT", False);
-
- wm_root = DefaultRootWindow (wm_disp);
-
- /* set event mask for events on root window */
- XGetWindowAttributes (wm_disp, wm_root, &attribs);
- XSelectInput (wm_disp, wm_root,
- attribs.your_event_mask |
- SubstructureNotifyMask |
- SubstructureRedirectMask);
-
- if (trap_pop () != 0)
- return;
-
- trap_push ();
-
- add_all_current_windows ();
-
- source = g_source_new (&event_funcs, sizeof (GSource));
-
- event_poll_fd.fd = ConnectionNumber (wm_disp);
- event_poll_fd.events = G_IO_IN;
-
- g_source_add_poll (source, &event_poll_fd);
- g_source_set_priority (source, GDK_PRIORITY_EVENTS);
- g_source_set_can_recurse (source, FALSE);
- g_source_attach (source, NULL);
-
- trap_pop ();
-}
-
-void
-gdm_wm_focus_new_windows (gboolean focus)
-{
- focus_new_windows = focus;
-}
-
-void
-gdm_wm_no_login_focus_push (void)
-{
- /* it makes not sense for this to be false then */
- focus_new_windows = TRUE;
- no_focus_login++;
-}
-
-void
-gdm_wm_no_login_focus_pop (void)
-{
- no_focus_login --;
-
- if (no_focus_login == 0 &&
- wm_focus_window == None &&
- wm_login_window != None)
- gdm_wm_focus_window (wm_login_window);
-}
-
-void
-gdm_wm_get_window_pos (Window window, int *xp, int *yp)
-{
- int x, y;
- Window root;
- unsigned int width, height, border, depth;
- GdmWindow *gw;
-
- trap_push ();
-
- gw = find_window (window, TRUE);
-
- if (gw == NULL) {
- XGetGeometry (wm_disp, window,
- &root, &x, &y, &width, &height, &border, &depth);
-
- *xp = x;
- *yp = y;
-
- trap_pop ();
-
- return;
- }
-
- if (gw->deco != None) {
- XGetGeometry (wm_disp, gw->deco,
- &root, &x, &y, &width, &height, &border, &depth);
- *xp = x + 1;
- *yp = y + 1;
- } else {
- XGetGeometry (wm_disp, gw->win,
- &root, &x, &y, &width, &height, &border, &depth);
- *xp = x;
- *yp = y;
- }
-
- trap_pop ();
-}
-
-void
-gdm_wm_move_window_now (Window window, int x, int y)
-{
- GdmWindow *gw;
-
- trap_push ();
-
- gw = find_window (window, TRUE);
-
- if (gw == NULL) {
- XMoveWindow (wm_disp, window, x, y);
-
- XSync (wm_disp, False);
- trap_pop ();
- return;
- }
-
- if (gw->deco != None)
- XMoveWindow (wm_disp, gw->deco, x - 1, y - 1);
- else
- XMoveWindow (wm_disp, gw->win, x, y);
- if (gw->shadow != None)
- XMoveWindow (wm_disp, gw->deco, x + 4, y + 4);
-
- XSync (wm_disp, False);
- trap_pop ();
-}
-
-void
-gdm_wm_save_wm_order (void)
-{
- Window *children = NULL;
- Window xparent, xroot;
- guint size = 0;
- int dlen = 0;
- unsigned long *data;
-
- gdk_flush ();
- XSync (wm_disp, False);
- trap_push ();
-
- XGrabServer (wm_disp);
-
- if (XQueryTree (wm_disp,
- wm_root,
- &xroot,
- &xparent,
- &children,
- &size)) {
- int i;
- Atom atom;
- data = g_new0 (unsigned long, size);
-
- for (i = 0; i < size; i++) {
- GdmWindow *gw = find_window (children[i], TRUE);
-
- /* Ignore unknowns and shadows */
- if (gw == NULL ||
- gw->shadow == children[i])
- continue;
-
- if (gw->win == wm_login_window) {
- /* Empty spot in the list signifies the
- * login window */
- data [dlen++] = None;
- } else {
- data [dlen++] = gw->win;
- }
- }
-
- atom = XInternAtom (wm_disp, "GDMWM_WINDOW_ORDER", False);
-
- XChangeProperty (wm_disp, wm_root,
- atom,
- XA_CARDINAL,
- 32,
- PropModeReplace,
- (unsigned char *)data,
- dlen);
-
- if (children != NULL)
- XFree (children);
- g_free (data);
- }
-
- XUngrabServer (wm_disp);
-
- trap_pop ();
-}
-
-static gboolean
-focus_win (gpointer data)
-{
- Window focus = (Window)data;
- focus_new_windows = TRUE;
- gdm_wm_focus_window (focus);
- return FALSE;
-}
-
-void
-gdm_wm_restore_wm_order (void)
-{
- guint32 *data;
- Window focus = None;
- int size;
- int i;
- Atom atom;
-
- gdk_flush ();
- XSync (wm_disp, False);
-
- process_events ();
-
- gdk_flush ();
- XSync (wm_disp, False);
- trap_push ();
-
- XGrabServer (wm_disp);
-
- atom = XInternAtom (wm_disp, "GDMWM_WINDOW_ORDER", False);
-
- data = get_typed_property_data (wm_disp, wm_root,
- atom, XA_CARDINAL,
- &size, 32);
-
- if (data != NULL) {
- for (i = 0; i < size/4; i++) {
- GdmWindow *gw;
- if (data[i] == None)
- gw = find_window (wm_login_window, TRUE);
- else
- gw = find_window (data[i], TRUE);
-
- if (gw != NULL) {
- focus = gw->win;
- if (gw->shadow != None)
- XRaiseWindow (wm_disp, gw->shadow);
- if (gw->deco != None)
- XRaiseWindow (wm_disp, gw->deco);
- else
- XRaiseWindow (wm_disp, gw->win);
- }
- }
-
- g_free (data);
- }
-
- XUngrabServer (wm_disp);
-
- trap_pop ();
-
- process_events ();
-
- if (focus != None) {
- /* let us hit the main loop first */
- g_idle_add (focus_win, (gpointer)focus);
- }
-}
-
-void
-gdm_wm_show_info_msg_dialog (const gchar *msg_file,
- const gchar *msg_font)
-{
- GtkWidget *dialog, *label;
- gchar *InfoMsg;
- gsize InfoMsgLength;
-
- if (ve_string_empty (msg_file) ||
- ! g_file_test (msg_file, G_FILE_TEST_EXISTS) ||
- ! g_file_get_contents (msg_file, &InfoMsg, &InfoMsgLength, NULL))
- return;
-
- if (InfoMsgLength <= 0) {
- g_free (InfoMsg);
- return;
- }
-
- gdm_wm_focus_new_windows (TRUE);
- dialog = gtk_dialog_new_with_buttons (NULL /* Message */,
- NULL /* parent */, GTK_DIALOG_MODAL |
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
- NULL);
- label = gtk_label_new (InfoMsg);
-
- if (msg_font && strlen (msg_font) > 0) {
- PangoFontDescription *GdmInfoMsgFontDesc = pango_font_description_from_string (msg_font);
- if (GdmInfoMsgFontDesc) {
- gtk_widget_modify_font (label, GdmInfoMsgFontDesc);
- pango_font_description_free (GdmInfoMsgFontDesc);
- }
- }
-
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), label);
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
-
- g_free (InfoMsg);
-}
-
-void
-gdm_wm_message_dialog (const gchar *primary_message,
- const gchar *secondary_message)
-{
- GtkWidget *req = NULL;
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- req = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- primary_message,
- secondary_message);
-
- gdm_wm_center_window (GTK_WINDOW (req));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (req));
- gtk_widget_destroy (req);
- gdm_wm_no_login_focus_pop ();
-}
-
-gint
-gdm_wm_query_dialog (const gchar *primary_message,
- const gchar *secondary_message,
- const char *posbutton,
- const char *negbutton,
- gboolean has_cancel)
-{
- int ret;
- GtkWidget *req;
- GtkWidget *button;
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- req = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_QUESTION,
- GTK_BUTTONS_NONE,
- primary_message,
- secondary_message);
-
- if (negbutton != NULL) {
- button = gtk_button_new_from_stock (negbutton);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_NO);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (has_cancel == TRUE) {
- button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_CANCEL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (posbutton != NULL) {
- button = gtk_button_new_from_stock (posbutton);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_YES);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (posbutton != NULL)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_YES);
- else if (negbutton != NULL)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_NO);
- else if (has_cancel)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_CANCEL);
-
- gdm_wm_center_window (GTK_WINDOW (req));
-
- gdm_wm_no_login_focus_push ();
- ret = gtk_dialog_run (GTK_DIALOG (req));
- gdm_wm_no_login_focus_pop ();
- gtk_widget_destroy (req);
-
- return ret;
-}
-
-gint
-gdm_wm_warn_dialog (const gchar *primary_message,
- const gchar *secondary_message,
- const char *posbutton,
- const char *negbutton,
- gboolean has_cancel)
-{
- int ret;
- GtkWidget *req;
- GtkWidget *button;
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- req = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- primary_message,
- secondary_message);
-
- if (negbutton != NULL) {
- button = gtk_button_new_from_stock (negbutton);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_NO);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (has_cancel == TRUE) {
- button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_CANCEL);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (posbutton != NULL) {
- button = gtk_button_new_from_stock (posbutton);
- gtk_dialog_add_action_widget (GTK_DIALOG (req), button, GTK_RESPONSE_YES);
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- }
-
- if (posbutton != NULL)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_YES);
- else if (negbutton != NULL)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_NO);
- else if (has_cancel)
- gtk_dialog_set_default_response (GTK_DIALOG (req), GTK_RESPONSE_CANCEL);
-
- gdm_wm_center_window (GTK_WINDOW (req));
-
- gdm_wm_no_login_focus_push ();
- ret = gtk_dialog_run (GTK_DIALOG (req));
- gdm_wm_no_login_focus_pop ();
- gtk_widget_destroy (req);
-
- return ret;
-}
-
-/* EOF */
diff --git a/gui/gdmwm.h b/gui/gdmwm.h
deleted file mode 100644
index d3449a2a..00000000
--- a/gui/gdmwm.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file Copyright (c) 2001 George Lebl
- *
- * 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 GDM_WM_H
-#define GDM_WM_H
-
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-#include <X11/X.h>
-#include <X11/Xlib.h>
-
-/*
- * Login window will be given focus every time a window
- * is killed
- */
-void gdm_wm_init (Window login_window);
-
-/*
- * By default new windows aren't given focus, you have to
- * call this function with a TRUE
- */
-void gdm_wm_focus_new_windows (gboolean focus);
-
-void gdm_wm_focus_window (Window window);
-
-/* Movement for the impatient */
-void gdm_wm_move_window_now (Window window,
- int x,
- int y);
-void gdm_wm_get_window_pos (Window window,
- int *xp,
- int *yp);
-
-/* Refuse to focus the login window, poor mans modal dialogs */
-void gdm_wm_no_login_focus_push (void);
-void gdm_wm_no_login_focus_pop (void);
-
-/*
- * Xinerama support stuff
- */
-void gdm_wm_screen_init (int cur_screen_num);
-void gdm_wm_set_screen (int cur_screen_num);
-
-/*
- * Not really a WM function, center a gtk window on current screen
- * by setting uposition
- */
-void gdm_wm_center_window (GtkWindow *cw);
-
-/* Center mouse pointer
- */
-void gdm_wm_center_cursor (void);
-
-/*
- * Save and restore stacking order, useful for restarting
- * the greeter
- */
-void gdm_wm_save_wm_order (void);
-void gdm_wm_restore_wm_order (void);
-
-/* Dialogs */
-gint gdm_wm_query_dialog (const gchar *primary_message,
- const gchar *secondary_message,
- const char *posbutton,
- const char *negbutton,
- gboolean has_cancel);
-gint gdm_wm_warn_dialog (const gchar *primary_message,
- const gchar *secondary_message,
- const char *posbutton,
- const char *negbutton,
- gboolean has_cancel);
-void gdm_wm_show_info_msg_dialog (const gchar *msg_file,
- const gchar *msg_font);
-void gdm_wm_message_dialog (const gchar *primary_message,
- const gchar *secondary_message);
-
-/* Access to the screen structures */
-extern GdkRectangle *gdm_wm_allscreens;
-extern int gdm_wm_screens;
-extern GdkRectangle gdm_wm_screen;
-
-#endif /* GDM_WM_H */
-
-/* EOF */
diff --git a/gui/greeter/.cvsignore b/gui/greeter/.cvsignore
deleted file mode 100644
index 7db66fb3..00000000
--- a/gui/greeter/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-gdmgreeter
-.deps
-.libs
-gdmthemetester
diff --git a/gui/greeter/Makefile.am b/gui/greeter/Makefile.am
deleted file mode 100644
index 7d0f355b..00000000
--- a/gui/greeter/Makefile.am
+++ /dev/null
@@ -1,97 +0,0 @@
-SUBDIRS = . themes
-
-## Process this file with automake to produce makefile.in
-INCLUDES = \
- -I. \
- -I$(top_srcdir)/gui \
- -I$(top_srcdir)/daemon \
- -I$(top_srcdir)/vicious-extensions \
- -DAUTHDIR=\""$(authdir)"\" \
- -DDATADIR=\""$(datadir)"\" \
- -DDMCONFDIR=\""$(dmconfdir)"\" \
- -DGDM_CONFIG_FILE=\"$(gdmconfdir)/gdm.conf\" \
- -DGDMLOCALEDIR=\""$(gdmlocaledir)"\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- -DLIBEXECDIR=\""$(libexecdir)"\" \
- -DSBINDIR=\""$(sbindir)"\" \
- -DPIXMAPDIR=\""$(pixmapdir)"\" \
- $(GUI_CFLAGS) \
- $(PANGO_CFLAGS) \
- $(PANGOFT_CFLAGS) \
- $(GREETER_CFLAGS)
-
-#
-# -DG_DISABLE_DEPRECATED \
-# -DGDK_DISABLE_DEPRECATED \
-# -DGDK_PIXBUF_DISABLE_DEPRECATED \
-# -DGTK_DISABLE_DEPRECATED \
-# -DGNOME_DISABLE_DEPRECATED \
-#
-
-libexec_PROGRAMS = \
- gdmgreeter
-
-bin_SCRIPTS = \
- gdmthemetester
-
-CLEANFILES = gdmthemetester
-
-gdmthemetester: $(srcdir)/gdmthemetester.in
- sed -e 's,[@]libexecdir[@],$(libexecdir),g' \
- <$(srcdir)/gdmthemetester.in >gdmthemetester
-
-gdmgreeter_SOURCES = \
- greeter.c \
- greeter.h \
- greeter_action_language.c \
- greeter_action_language.h \
- greeter_canvas_text.c \
- greeter_canvas_text.h \
- greeter_canvas_item.c \
- greeter_canvas_item.h \
- greeter_configuration.h \
- greeter_events.c \
- greeter_events.h \
- greeter_geometry.c \
- greeter_geometry.h \
- greeter_item.c \
- greeter_item_timed.c \
- greeter_item_timed.h \
- greeter_item_capslock.c \
- greeter_item_capslock.h \
- greeter_item_clock.c \
- greeter_item_clock.h \
- greeter_item.h \
- greeter_item_pam.c \
- greeter_item_pam.h \
- greeter_item_ulist.c \
- greeter_item_ulist.h \
- greeter_item_customlist.c \
- greeter_item_customlist.h \
- greeter_parser.c \
- greeter_parser.h \
- greeter_session.c \
- greeter_session.h \
- greeter_system.c \
- greeter_system.h
-
-gdmgreeter_LDADD = \
- -L$(top_builddir)/gui \
- -lgdmwm \
- -lgdmcommon \
- $(top_builddir)/vicious-extensions/libviciousui-minimal.a \
- $(GLIB_LIBS) \
- $(GOBJECT_LIBS) \
- $(PANGO_LIBS) \
- $(PANGOFT_LIBS) \
- $(GDK_LIBS) \
- $(GDKPIXBUF_LIBS) \
- $(GREETER_LIBS) \
- $(X_EXTRA_LIBS) \
- $(XINERAMA_LIBS) \
- $(X_LIBS) \
- -lX11
-
-EXTRA_DIST = \
- gdmthemetester.in \
- greeter.dtd
diff --git a/gui/greeter/gdmthemetester.in b/gui/greeter/gdmthemetester.in
deleted file mode 100755
index 139e1e01..00000000
--- a/gui/greeter/gdmthemetester.in
+++ /dev/null
@@ -1,109 +0,0 @@
-#!/bin/sh
-
-gdmwhich () {
- COMMAND="$1"
- OUTPUT=
- IFS=:
- for dir in $PATH
- do
- if test -x "$dir/$COMMAND" ; then
- if test "x$OUTPUT" = "x" ; then
- OUTPUT="$dir/$COMMAND"
- fi
- fi
- done
- IFS=$OLD_IFS
- echo "$OUTPUT"
-}
-
-echo
-echo "GDM Theme Tester"
-echo
-echo "Be sure to test all the environments:"
-echo " console, console-timed, flexi, remote-flexi, xdmcp"
-echo "Also be sure to test using caps lock"
-echo
-
-XNEST=`gdmwhich Xnest`
-GDMXNEST=`gdmwhich gdmXnest`
-GDMGREETER="@libexecdir@/gdmgreeter"
-
-if [ x$XNEST = x ]; then
- echo "ERROR: Xnest not found"
- echo ""
- exit 1
-fi
-
-if [ x$GDMXNEST = x ]; then
- echo "ERROR: gdmXnest not found"
- echo ""
- exit 1
-fi
-
-if [ x$GDMGREETER = x ]; then
- echo "ERROR: gdmgreeter not found"
- echo ""
- exit 1
-fi
-
-USAGE="
-Usage: $0 <environment> <theme>
-<environment> is one of: console, console-timed, flexi, remote-flexi, xdmcp
-<theme> is either the path of the theme or the name of an installed theme
-
-If you set the environment variable XNESTSIZE to <width>x<height> (e.g. 800x600)
-you can test the greeter at that resolution
-"
-if [ "$#" != 2 ]; then
- echo "$USAGE"
- exit 1
-fi
-
-GDM_THEME="$2"
-DOING_GDM_DEVELOPMENT=yes
-GDM_PARENT_DISPLAY="$DISPLAY"
-export GDM_THEME DOING_GDM_DEVELOPMENT GDM_PARENT_DISPLAY
-
-case $1 in
-console)
- GDM_IS_LOCAL=yes
- export GDM_IS_LOCAL
- ;;
-console-timed)
- GDM_IS_LOCAL=yes
- GDM_FAKE_TIMED=yes
- export GDM_IS_LOCAL GDM_FAKE_TIMED
- ;;
-flexi)
- GDM_IS_LOCAL=yes
- GDM_FLEXI_SERVER=yes
- export GDM_IS_LOCAL GDM_FLEXI_SERVER
- ;;
-remote-flexi)
- GDM_FLEXI_SERVER=yes
- export GDM_FLEXI_SERVER
- ;;
-xdmcp)
- ;;
-*)
- echo "$USAGE"
- exit 1
- ;;
-esac
-
-if [ "x$XNESTSIZE" = x ] ; then
- eval `gdmXnest -b`
-else
- eval `gdmXnest -b -o "-geometry $XNESTSIZE"`
-fi
-export DISPLAY
-
-if [ "x$GDM_PARENT_DISPLAY" = "x$DISPLAY" ]; then
- echo "ERROR: Can't start the Xnest server"
- exit 1
-fi
-
-# This may not be necessary
-sleep 1
-
-@libexecdir@/gdmgreeter
diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c
deleted file mode 100644
index 66347ef3..00000000
--- a/gui/greeter/greeter.c
+++ /dev/null
@@ -1,1610 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <libintl.h>
-#include <locale.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <syslog.h>
-
-#if HAVE_PAM
-#include <security/pam_appl.h>
-#define PW_ENTRY_SIZE PAM_MAX_RESP_SIZE
-#else
-#define PW_ENTRY_SIZE GDM_MAX_PASS
-#endif
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
-#include <libgnomecanvas/libgnomecanvas.h>
-
-#include "vicious.h"
-
-#include "gdm.h"
-#include "gdmwm.h"
-#include "gdmcomm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "gdmsession.h"
-
-#include "greeter.h"
-#include "greeter_configuration.h"
-#include "greeter_parser.h"
-#include "greeter_geometry.h"
-#include "greeter_item_clock.h"
-#include "greeter_item_pam.h"
-#include "greeter_item_ulist.h"
-#include "greeter_item_customlist.h"
-#include "greeter_item_capslock.h"
-#include "greeter_item_timed.h"
-#include "greeter_events.h"
-#include "greeter_action_language.h"
-#include "greeter_session.h"
-#include "greeter_system.h"
-
-gboolean DOING_GDM_DEVELOPMENT = FALSE;
-
-GtkWidget *window;
-GtkWidget *canvas;
-
-gboolean GDM_IS_LOCAL = FALSE;
-static gboolean ignore_buttons = FALSE;
-gboolean GdmHaltFound = FALSE;
-gboolean GdmRebootFound = FALSE;
-gboolean *GdmCustomCmdsFound = NULL;
-gboolean GdmAnyCustomCmdsFound = FALSE;
-gboolean GdmSuspendFound = FALSE;
-gboolean GdmConfiguratorFound = FALSE;
-
-/* FIXME: hack */
-GreeterItemInfo *welcome_string_info = NULL;
-
-extern gboolean session_dir_whacked_out;
-extern gboolean require_quarter;
-extern gint gdm_timed_delay;
-extern GtkButton *gtk_ok_button;
-extern GtkButton *gtk_start_again_button;
-
-gboolean greeter_probably_login_prompt = FALSE;
-static gboolean first_prompt = TRUE;
-
-static void process_operation (guchar opcode, const gchar *args);
-
-void
-greeter_ignore_buttons (gboolean val)
-{
- ignore_buttons = val;
-}
-
-/* If in random theme mode then grab a random theme from those selected */
-static char *
-get_random_theme ()
-{
- char **vec;
- char *themes_list;
- char *theme;
- int size;
- int i;
-
- themes_list = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMES);
-
- if (ve_string_empty (themes_list))
- return NULL;
-
- vec = g_strsplit (themes_list, GDM_DELIMITER_THEMES, -1);
- if (vec == NULL)
- return NULL;
-
- /* Get Number of elements in vector */
- for (size = 0; vec[size] != NULL; size++) {}
-
- /* Get Random Theme from list */
- srand (time (NULL));
- i = rand () % size;
- theme = g_strdup (vec[i]);
- g_strfreev (vec);
-
- return theme;
-}
-
-static gboolean
-greeter_ctrl_handler (GIOChannel *source,
- GIOCondition cond,
- gint fd)
-{
- gchar buf[PIPE_SIZE];
- gchar *p;
- gsize len;
-
- /* If this is not incoming i/o then return */
- if (cond != G_IO_IN)
- return TRUE;
-
- /* Read random garbage from i/o channel until first STX is found */
- do {
- g_io_channel_read_chars (source, buf, 1, &len, NULL);
-
- if (len != 1)
- return TRUE;
- } while (buf[0] && buf[0] != STX);
-
- memset (buf, '\0', sizeof (buf));
- if (g_io_channel_read_chars (source, buf, sizeof (buf) - 1, &len, NULL) !=
- G_IO_STATUS_NORMAL)
- return TRUE;
-
- p = memchr (buf, STX, len);
- if (p != NULL) {
- len = p - buf;
- g_io_channel_seek_position (source, -((sizeof (buf) - 1) - len), G_SEEK_CUR, NULL);
- memset (buf + len, '\0', (sizeof (buf) - 1) - len);
- }
- buf[len - 1] = '\0';
-
- process_operation ((guchar) buf[0], buf + 1);
- return TRUE;
-}
-
-static void
-process_operation (guchar op_code,
- const gchar *args)
-{
- GtkWidget *dlg;
- char *tmp;
- char *session;
- GreeterItemInfo *conversation_info;
- static GnomeCanvasItem *disabled_cover = NULL;
- gchar *language;
- gchar *selected_user = NULL;
- gint lookup_status = SESSION_LOOKUP_SUCCESS;
- gchar *firstmsg = NULL;
- gchar *secondmsg = NULL;
- gint save_session = GTK_RESPONSE_NO;
-
- /* Parse opcode */
- switch (op_code) {
- case GDM_SETLOGIN:
- /* somebody is trying to fool us this is the user that
- * wants to log in, and well, we are the gullible kind */
-
- greeter_item_pam_set_user (args);
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_PROMPT:
- tmp = ve_locale_to_utf8 (args);
- if (tmp != NULL && strcmp (tmp, _("Username:")) == 0) {
- gdm_common_login_sound (gdm_config_get_string (GDM_KEY_SOUND_PROGRAM),
- gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE),
- gdm_config_get_bool (GDM_KEY_SOUND_ON_LOGIN));
- greeter_probably_login_prompt = TRUE;
- }
- if (gtk_ok_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), FALSE);
-
- if (gtk_start_again_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_start_again_button), !first_prompt);
-
- first_prompt = FALSE;
-
- greeter_ignore_buttons (FALSE);
-
- greeter_item_pam_prompt (tmp, PW_ENTRY_SIZE, TRUE);
- g_free (tmp);
- break;
-
- case GDM_NOECHO:
- tmp = ve_locale_to_utf8 (args);
-
- greeter_probably_login_prompt = FALSE;
-
- if (gtk_ok_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), FALSE);
-
- if (gtk_start_again_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_start_again_button), !first_prompt);
-
- first_prompt = FALSE;
-
- greeter_ignore_buttons (FALSE);
- greeter_item_pam_prompt (tmp, PW_ENTRY_SIZE, FALSE);
- g_free (tmp);
-
- break;
-
- case GDM_MSG:
- tmp = ve_locale_to_utf8 (args);
- greeter_item_pam_message (tmp);
- g_free (tmp);
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_ERRBOX:
- tmp = ve_locale_to_utf8 (args);
- greeter_item_pam_error (tmp);
- g_free (tmp);
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_ERRDLG:
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- tmp = ve_locale_to_utf8 (args);
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- tmp,
- "");
- g_free (tmp);
-
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_SESS:
- tmp = ve_locale_to_utf8 (args);
- session = gdm_session_lookup (tmp, &lookup_status);
- if (lookup_status != SESSION_LOOKUP_SUCCESS) {
- switch (lookup_status) {
- case SESSION_LOOKUP_PREFERRED_MISSING:
- firstmsg = g_strdup_printf (_("Do you wish to make %s the default for "
- "future sessions?"),
- gdm_session_name (tmp));
- secondmsg = g_strdup_printf (_("Your preferred session type %s is not "
- "installed on this computer."),
- gdm_session_name (gdm_get_default_session ()));
- save_session = gdm_wm_query_dialog (firstmsg, secondmsg,
- _("Make _Default"), _("Just _Log In"), TRUE);
-
- g_free (firstmsg);
- g_free (secondmsg);
- gdm_set_save_session (save_session);
- break;
-
- case SESSION_LOOKUP_DEFAULT_MISMATCH:
- firstmsg = g_strdup_printf (_("Do you wish to make %s the default for "
- "future sessions?"),
- gdm_session_name (session));
- secondmsg = g_strdup_printf (_("You have chosen %s for this "
- "session, but your default "
- "setting is %s."),
- gdm_session_name (session),
- gdm_session_name (tmp));
- save_session = gdm_wm_query_dialog (firstmsg, secondmsg,
- _("Make _Default"), _("Just For _This Session"), TRUE);
-
- g_free (firstmsg);
- g_free (secondmsg);
- gdm_set_save_session (save_session);
- break;
- case SESSION_LOOKUP_USE_SWITCHDESK:
- firstmsg = g_strdup_printf (_("You have chosen %s for this "
- "session"),
- gdm_session_name (session));
- secondmsg = g_strdup_printf (_("If you wish to make %s "
- "the default for future sessions, "
- "run the 'switchdesk' utility "
- "(System->Desktop Switching Tool from "
- "the panel menu)."),
- gdm_session_name (session));
- gdm_wm_message_dialog (firstmsg, secondmsg);
- g_free (firstmsg);
- g_free (secondmsg);
- break;
-
- default:
- break;
- }
- }
- g_free (tmp);
- if (gdm_get_save_session () == GTK_RESPONSE_CANCEL) {
- printf ("%c%s\n", STX, GDM_RESPONSE_CANCEL);
- } else {
- tmp = ve_locale_from_utf8 (session);
- printf ("%c%s\n", STX, tmp);
- g_free (tmp);
- }
- fflush (stdout);
- g_free (session);
- break;
-
- case GDM_LANG:
- language = greeter_language_get_language (args);
- if (greeter_language_get_save_language () == GTK_RESPONSE_CANCEL)
- printf ("%c%s\n", STX, GDM_RESPONSE_CANCEL);
- else
- printf ("%c%s\n", STX, language);
- fflush (stdout);
- g_free (language);
- break;
-
- case GDM_SSESS:
- if (gdm_get_save_session () == GTK_RESPONSE_YES)
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- case GDM_SLANG:
- if (greeter_language_get_save_language () == GTK_RESPONSE_YES)
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- case GDM_RESET:
- /* fall thru to reset */
-
- case GDM_RESETOK:
-
- if (gtk_ok_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), FALSE);
- if (gtk_start_again_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_start_again_button), FALSE);
-
- first_prompt = TRUE;
-
- conversation_info = greeter_lookup_id ("pam-conversation");
-
- if (conversation_info)
- {
- tmp = ve_locale_to_utf8 (args);
- g_object_set (G_OBJECT (conversation_info->item),
- "text", tmp,
- NULL);
- g_free (tmp);
- }
-
- printf ("%c\n", STX);
- fflush (stdout);
- greeter_ignore_buttons (FALSE);
- greeter_item_ulist_enable ();
-
- break;
-
- case GDM_QUIT:
- greeter_item_timed_stop ();
-
- if (require_quarter) {
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- /* translators: This is a nice and evil eggie text, translate
- * to your favourite currency */
- _("Please insert 25 cents "
- "to log in."),
- "");
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
- }
-
- greeter_item_pam_leftover_messages ();
-
- gdk_flush ();
-
- printf ("%c\n", STX);
- fflush (stdout);
-
- /* screw gtk_main_quit, we want to make sure we definately die */
- _exit (EXIT_SUCCESS);
- break;
-
- case GDM_STARTTIMER:
- greeter_item_timed_start ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_STOPTIMER:
- greeter_item_timed_stop ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_DISABLE:
- gtk_widget_set_sensitive (window, FALSE);
-
- if (disabled_cover == NULL)
- {
- disabled_cover = gnome_canvas_item_new
- (gnome_canvas_root (GNOME_CANVAS (canvas)),
- GNOME_TYPE_CANVAS_RECT,
- "x1", 0.0,
- "y1", 0.0,
- "x2", (double)canvas->allocation.width,
- "y2", (double)canvas->allocation.height,
- "fill_color_rgba", (guint)0x00000088,
- NULL);
- }
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_ENABLE:
- gtk_widget_set_sensitive (window, TRUE);
-
- if (disabled_cover != NULL)
- {
- gtk_object_destroy (GTK_OBJECT (disabled_cover));
- disabled_cover = NULL;
- }
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- /* These are handled separately so ignore them here and send
- * back a NULL response so that the daemon quits sending them */
- case GDM_NEEDPIC:
- case GDM_READPIC:
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_NOFOCUS:
- gdm_wm_no_login_focus_push ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_FOCUS:
- gdm_wm_no_login_focus_pop ();
-
- printf ("%c\n", STX);
- fflush (stdout);
- break;
-
- case GDM_SAVEDIE:
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
-
- gdk_flush ();
-
- _exit (EXIT_SUCCESS);
-
- case GDM_QUERY_CAPSLOCK:
- if (greeter_is_capslock_on ())
- printf ("%cY\n", STX);
- else
- printf ("%c\n", STX);
- fflush (stdout);
-
- break;
-
- default:
- gdm_common_fail_greeter ("Unexpected greeter command received: '%c'", op_code);
- break;
- }
-}
-
-static gboolean
-key_press_event (GtkWidget *widget, GdkEventKey *key, gpointer data)
-{
- if (DOING_GDM_DEVELOPMENT && (key->keyval == GDK_Escape))
- {
- gtk_main_quit ();
-
- return TRUE;
- }
-
- return FALSE;
-}
-
-/*
- * The buttons with these handlers never appear in the F10 menu,
- * so they can make use of callback data.
- */
-static void
-greeter_ok_handler (GreeterItemInfo *info,
- gpointer user_data)
-{
- if (ignore_buttons == FALSE)
- {
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- GtkWidget *entry;
- entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
- greeter_ignore_buttons (TRUE);
- greeter_item_pam_login (GTK_ENTRY (entry), entry_info);
- }
- }
-}
-
-static void
-greeter_cancel_handler (GreeterItemInfo *info,
- gpointer user_data)
-{
- if (ignore_buttons == FALSE)
- {
- greeter_item_ulist_unset_selected_user ();
- greeter_item_ulist_disable ();
- greeter_ignore_buttons (TRUE);
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_CANCEL);
- fflush (stdout);
- }
-}
-
-static void
-greeter_setup_items (void)
-{
- greeter_item_clock_setup ();
- greeter_item_pam_setup ();
-
- /* This will query the daemon for pictures through stdin/stdout! */
- greeter_item_ulist_setup ();
-
- greeter_item_capslock_setup (window);
- greeter_item_timed_setup ();
- greeter_item_register_action_callback ("ok_button",
- greeter_ok_handler,
- (gpointer) window);
- greeter_item_register_action_callback ("cancel_button",
- greeter_cancel_handler,
- (gpointer) window);
- greeter_item_register_action_callback ("language_button",
- greeter_language_handler,
- NULL);
- greeter_item_register_action_callback ("disconnect_button",
- (ActionFunc)gtk_main_quit,
- NULL);
- greeter_item_system_setup ();
- greeter_item_session_setup ();
-
- /* Setup the custom widgets */
- greeter_item_customlist_setup ();
-}
-
-enum {
- RESPONSE_RESTART,
- RESPONSE_REBOOT,
- RESPONSE_CLOSE
-};
-
-static int
-verify_gdm_version (void)
-{
- const char *gdm_version;
- const char *gdm_protocol_version;
-
- gdm_version = g_getenv ("GDM_VERSION");
- gdm_protocol_version = g_getenv ("GDM_GREETER_PROTOCOL_VERSION");
-
- if (! DOING_GDM_DEVELOPMENT &&
- ((gdm_protocol_version != NULL &&
- strcmp (gdm_protocol_version, GDM_GREETER_PROTOCOL_VERSION) != 0) ||
- (gdm_protocol_version == NULL &&
- (gdm_version == NULL ||
- strcmp (gdm_version, VERSION) != 0))) &&
- (g_getenv ("GDM_IS_LOCAL") != NULL))
- {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version. "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- return EXIT_SUCCESS;
- }
-
- if (! DOING_GDM_DEVELOPMENT &&
- gdm_protocol_version == NULL &&
- gdm_version == NULL)
- {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version. "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("Restart Machine"),
- RESPONSE_REBOOT,
- GTK_STOCK_CLOSE,
- RESPONSE_CLOSE,
- NULL);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- switch (gtk_dialog_run (GTK_DIALOG (dialog)))
- {
- case RESPONSE_REBOOT:
- gtk_widget_destroy (dialog);
- return DISPLAY_REBOOT;
- default:
- gtk_widget_destroy (dialog);
- return DISPLAY_ABORT;
- }
- }
-
- if (! DOING_GDM_DEVELOPMENT &&
- ((gdm_protocol_version != NULL &&
- strcmp (gdm_protocol_version, GDM_GREETER_PROTOCOL_VERSION) != 0) ||
- (gdm_protocol_version == NULL &&
- strcmp (gdm_version, VERSION) != 0)))
- {
- GtkWidget *dialog;
- gchar *msg;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- msg = g_strdup_printf (_("The greeter version (%s) does not match the daemon "
- "version (%s). "
- "You have probably just upgraded GDM. "
- "Please restart the GDM daemon or the computer."),
- VERSION, gdm_version);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_NONE,
- _("Cannot start the greeter"),
- msg);
- g_free (msg);
-
- gtk_dialog_add_buttons (GTK_DIALOG (dialog),
- _("Restart GDM"),
- RESPONSE_RESTART,
- _("Restart Machine"),
- RESPONSE_REBOOT,
- GTK_STOCK_CLOSE,
- RESPONSE_CLOSE,
- NULL);
-
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), RESPONSE_RESTART);
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- switch (gtk_dialog_run (GTK_DIALOG (dialog)))
- {
- case RESPONSE_RESTART:
- gtk_widget_destroy (dialog);
- return DISPLAY_RESTARTGDM;
- case RESPONSE_REBOOT:
- gtk_widget_destroy (dialog);
- return DISPLAY_REBOOT;
- default:
- gtk_widget_destroy (dialog);
- return DISPLAY_ABORT;
- }
- }
-
- return 0;
-}
-
-static void
-gdm_set_welcomemsg (void)
-{
- char *welcomemsg = gdm_common_get_welcomemsg ();
-
- if (welcome_string_info->data.text.orig_text != NULL)
- g_free (welcome_string_info->data.text.orig_text);
-
- welcome_string_info->data.text.orig_text = welcomemsg;
- greeter_item_update_text (welcome_string_info);
-}
-
-/*
- * If new configuration keys are added to this program, make sure to add the
- * key to the gdm_read_config and gdm_reread_config functions. Note if the
- * number of configuration values used by gdmlogin is greater than
- * GDM_SUP_MAX_MESSAGES defined in daemon/gdm.h (currently defined to be 80),
- * consider bumping that number so that all the config can be read in one
- * socket connection.
- */
-static void
-gdm_read_config (void)
-{
- gint i;
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /*
- * Read all the keys at once and close sockets connection so we do
- * not have to keep the socket open.
- */
- gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME);
- gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMES);
- gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME_DIR);
- gdm_config_get_string (GDM_KEY_GTKRC);
- gdm_config_get_string (GDM_KEY_GTK_THEME);
- gdm_config_get_string (GDM_KEY_INCLUDE);
- gdm_config_get_string (GDM_KEY_EXCLUDE);
- gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
- gdm_config_get_string (GDM_KEY_LOCALE_FILE);
- gdm_config_get_string (GDM_KEY_HALT);
- gdm_config_get_string (GDM_KEY_REBOOT);
- gdm_config_get_string (GDM_KEY_SUSPEND);
- gdm_config_get_string (GDM_KEY_CONFIGURATOR);
- gdm_config_get_string (GDM_KEY_INFO_MSG_FILE);
- gdm_config_get_string (GDM_KEY_INFO_MSG_FONT);
- gdm_config_get_string (GDM_KEY_TIMED_LOGIN);
- gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMED_COLOR);
- gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE);
- gdm_config_get_string (GDM_KEY_DEFAULT_SESSION);
- gdm_config_get_string (GDM_KEY_SOUND_PROGRAM);
- gdm_config_get_string (GDM_KEY_SOUND_ON_LOGIN_FILE);
- gdm_config_get_string (GDM_KEY_USE_24_CLOCK);
- gdm_config_get_string (GDM_KEY_WELCOME);
- gdm_config_get_string (GDM_KEY_REMOTE_WELCOME);
- gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN);
- gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
- gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES);
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT);
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH);
- gdm_config_get_int (GDM_KEY_MINIMAL_UID);
- gdm_config_get_bool (GDM_KEY_ENTRY_CIRCLES);
- gdm_config_get_bool (GDM_KEY_ENTRY_INVISIBLE);
- gdm_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE);
- gdm_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE);
- gdm_config_get_bool (GDM_KEY_INCLUDE_ALL);
- gdm_config_get_bool (GDM_KEY_SYSTEM_MENU);
- gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE);
- gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON);
- gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE);
- gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND);
- gdm_config_get_bool (GDM_KEY_SHOW_LAST_SESSION);
- gdm_config_get_bool (GDM_KEY_ALLOW_ROOT);
- gdm_config_get_bool (GDM_KEY_ALLOW_REMOTE_ROOT);
- gdm_config_get_bool (GDM_KEY_SOUND_ON_LOGIN);
- gdm_config_get_bool (GDM_KEY_DEFAULT_WELCOME);
- gdm_config_get_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME);
- gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES);
-
- /* Keys for custom commands */
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = NULL;
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- gdm_config_get_string (key_string);
-
- g_free (key_string);
- }
-
- /* Keys not to include in reread_config */
- gdm_config_get_string (GDM_KEY_SESSION_DESKTOP_DIR);
- gdm_config_get_string (GDM_KEY_PRE_FETCH_PROGRAM);
-
- gdmcomm_comm_bulk_stop ();
-}
-
-static gboolean
-greeter_reread_config (int sig, gpointer data)
-{
- gint i;
- gboolean custom_changed = FALSE;
-
- /* Read config data in bulk */
- gdmcomm_comm_bulk_start ();
-
- if (gdm_config_reload_bool (GDM_KEY_DEBUG))
- gdmcomm_set_debug (gdm_config_get_bool (GDM_KEY_DEBUG));
-
- /* FIXME: The following is evil, we should update on the fly rather
- * then just restarting */
- /* Also we may not need to check ALL those keys but just a few */
- if (gdm_config_reload_string (GDM_KEY_GRAPHICAL_THEME) ||
- gdm_config_reload_string (GDM_KEY_GRAPHICAL_THEMES) ||
- gdm_config_reload_string (GDM_KEY_GRAPHICAL_THEME_DIR) ||
- gdm_config_reload_string (GDM_KEY_GTKRC) ||
- gdm_config_reload_string (GDM_KEY_GTK_THEME) ||
- gdm_config_reload_string (GDM_KEY_INCLUDE) ||
- gdm_config_reload_string (GDM_KEY_EXCLUDE) ||
- gdm_config_reload_string (GDM_KEY_SESSION_DESKTOP_DIR) ||
- gdm_config_reload_string (GDM_KEY_LOCALE_FILE) ||
- gdm_config_reload_string (GDM_KEY_HALT) ||
- gdm_config_reload_string (GDM_KEY_REBOOT) ||
- gdm_config_reload_string (GDM_KEY_SUSPEND) ||
- gdm_config_reload_string (GDM_KEY_CONFIGURATOR) ||
- gdm_config_reload_string (GDM_KEY_INFO_MSG_FILE) ||
- gdm_config_reload_string (GDM_KEY_INFO_MSG_FONT) ||
- gdm_config_reload_string (GDM_KEY_TIMED_LOGIN) ||
- gdm_config_reload_string (GDM_KEY_GRAPHICAL_THEMED_COLOR) ||
- gdm_config_reload_string (GDM_KEY_BACKGROUND_COLOR) ||
- gdm_config_reload_string (GDM_KEY_DEFAULT_FACE) ||
- gdm_config_reload_string (GDM_KEY_DEFAULT_SESSION) ||
- gdm_config_reload_int (GDM_KEY_XINERAMA_SCREEN) ||
- gdm_config_reload_int (GDM_KEY_TIMED_LOGIN_DELAY) ||
- gdm_config_reload_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_HEIGHT) ||
- gdm_config_reload_int (GDM_KEY_MAX_ICON_WIDTH) ||
- gdm_config_reload_int (GDM_KEY_MINIMAL_UID) ||
- gdm_config_reload_bool (GDM_KEY_ENTRY_CIRCLES) ||
- gdm_config_reload_bool (GDM_KEY_ENTRY_INVISIBLE) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_XTERM_FAILSAFE) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_GNOME_FAILSAFE) ||
- gdm_config_reload_bool (GDM_KEY_INCLUDE_ALL) ||
- gdm_config_reload_bool (GDM_KEY_SYSTEM_MENU) ||
- gdm_config_reload_bool (GDM_KEY_CONFIG_AVAILABLE) ||
- gdm_config_reload_bool (GDM_KEY_CHOOSER_BUTTON) ||
- gdm_config_reload_bool (GDM_KEY_TIMED_LOGIN_ENABLE) ||
- gdm_config_reload_bool (GDM_KEY_GRAPHICAL_THEME_RAND) ||
- gdm_config_reload_bool (GDM_KEY_SHOW_LAST_SESSION) ||
- gdm_config_reload_bool (GDM_KEY_ALLOW_ROOT) ||
- gdm_config_reload_bool (GDM_KEY_ALLOW_REMOTE_ROOT) ||
- gdm_config_reload_bool (GDM_KEY_ADD_GTK_MODULES)) {
-
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
- gdmcomm_comm_bulk_stop ();
-
- _exit (DISPLAY_RESTARTGREETER);
- }
-
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar *key_string = NULL;
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- if (gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- if (gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- if (gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, i);
- if (gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- if (gdm_config_reload_string (key_string))
- custom_changed = TRUE;
-
- g_free (key_string);
- }
-
- if(custom_changed){
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
- gdmcomm_comm_bulk_stop ();
-
- _exit (DISPLAY_RESTARTGREETER);
- }
-
- gdm_config_reload_string (GDM_KEY_SOUND_PROGRAM);
- gdm_config_reload_bool (GDM_KEY_SOUND_ON_LOGIN);
- gdm_config_reload_string (GDM_KEY_SOUND_ON_LOGIN_FILE);
- gdm_config_reload_string (GDM_KEY_USE_24_CLOCK);
-
- if (gdm_config_reload_string (GDM_KEY_WELCOME) ||
- gdm_config_reload_bool (GDM_KEY_DEFAULT_WELCOME) ||
- gdm_config_reload_string (GDM_KEY_REMOTE_WELCOME) ||
- gdm_config_reload_bool (GDM_KEY_DEFAULT_REMOTE_WELCOME)) {
-
- gdm_set_welcomemsg ();
-
- /* Set busy cursor */
- gdm_common_setup_cursor (GDK_WATCH);
-
- gdm_wm_save_wm_order ();
- gdmcomm_comm_bulk_stop ();
-
- _exit (DISPLAY_RESTARTGREETER);
- }
-
- gdmcomm_comm_bulk_stop ();
-
- return TRUE;
-}
-
-static void
-greeter_done (int sig)
-{
- _exit (EXIT_SUCCESS);
-}
-
-
-static char *
-get_theme_file (const char *in, char **theme_dir)
-{
- char *file, *dir, *info, *s;
-
- if (in == NULL)
- in = "circles";
-
- *theme_dir = NULL;
-
- if (g_path_is_absolute (in))
- {
- dir = g_strdup (in);
- }
- else
- {
- dir = NULL;
- if (DOING_GDM_DEVELOPMENT)
- {
- if (g_access (in, F_OK) == 0)
- {
- dir = g_strdup (in);
- }
- else
- {
- dir = g_build_filename ("themes", in, NULL);
- if (g_access (dir, F_OK) != 0)
- {
- g_free (dir);
- dir = NULL;
- }
- }
- }
- if (dir == NULL)
- dir = g_build_filename (gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME_DIR), in, NULL);
- }
-
- *theme_dir = dir;
-
- info = g_build_filename (dir, "GdmGreeterTheme.desktop", NULL);
- if (g_access (info, F_OK) != 0) {
- g_free (info);
- info = g_build_filename (dir, "GdmGreeterTheme.info", NULL);
- }
- if (g_access (info, F_OK) != 0)
- {
- char *base = g_path_get_basename (in);
- /* just guess the name, we have no info about the theme at
- * this point */
- g_free (info);
- file = g_strdup_printf ("%s/%s.xml", dir, base);
- g_free (base);
- return file;
- }
-
- s = gdm_get_theme_greeter (info, in);
- file = g_build_filename (dir, s, NULL);
-
- g_free (info);
- g_free (s);
-
- return file;
-}
-
-/* The reaping stuff */
-static time_t last_reap_delay = 0;
-
-static gboolean
-delay_reaping (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- last_reap_delay = time (NULL);
- return TRUE;
-}
-
-static gboolean
-reap_flexiserver (gpointer data)
-{
- int reapminutes = gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES);
-
- if (reapminutes > 0 &&
- ((time (NULL) - last_reap_delay) / 60) > reapminutes) {
- _exit (DISPLAY_REMANAGE);
- }
- return TRUE;
-}
-
-static gboolean
-gdm_event (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GdkEvent *event;
-
- /* HAAAAAAAAAAAAAAAAACK */
- /* Since the user has not logged in yet and may have left/right
- * mouse buttons switched, we just translate every right mouse click
- * to a left mouse click */
- if (n_param_values != 2 ||
- !G_VALUE_HOLDS (&param_values[1], GDK_TYPE_EVENT))
- return FALSE;
-
- event = g_value_get_boxed (&param_values[1]);
- if ((event->type == GDK_BUTTON_PRESS ||
- event->type == GDK_2BUTTON_PRESS ||
- event->type == GDK_3BUTTON_PRESS ||
- event->type == GDK_BUTTON_RELEASE)
- && event->button.button == 3)
- event->button.button = 1;
-
- /* Support Ctrl-U for blanking the username/password entry */
- if (event->type == GDK_KEY_PRESS &&
- (event->key.state & GDK_CONTROL_MASK) &&
- (event->key.keyval == GDK_u ||
- event->key.keyval == GDK_U)) {
-
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- GtkWidget *entry;
- entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- }
- }
-
- return TRUE;
-}
-
-int
-main (int argc, char *argv[])
-{
- char *bg_color;
- struct sigaction hup;
- struct sigaction term;
- sigset_t mask;
- GIOChannel *ctrlch;
- GError *error;
- GreeterItemInfo *root;
- char *theme_file;
- char *theme_dir;
- gchar *gdm_graphical_theme;
- const char *gdm_gtk_theme;
- guint sid;
- int r;
- gint i;
-
- if (g_getenv ("DOING_GDM_DEVELOPMENT") != NULL)
- DOING_GDM_DEVELOPMENT = TRUE;
-
- gdm_common_openlog ("gdmgreeter", LOG_PID, LOG_DAEMON);
-
- bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-
- setlocale (LC_ALL, "");
-
- if (ve_string_empty (g_getenv ("GDM_IS_LOCAL")))
- GDM_IS_LOCAL = FALSE;
- else
- GDM_IS_LOCAL = TRUE;
-
- /*
- * gdm_common_atspi_launch () needs gdk initialized.
- * We cannot start gtk before the registry is running
- * because the atk-bridge will crash.
- */
- gdk_init (&argc, &argv);
- if (! DOING_GDM_DEVELOPMENT) {
- gdm_common_atspi_launch ();
- }
-
- gtk_init (&argc, &argv);
-
- gdm_common_setup_cursor (GDK_WATCH);
-
- /* Read all configuration at once, so the values get cached */
- gdm_read_config ();
-
- if ( ! ve_string_empty (gdm_config_get_string (GDM_KEY_GTKRC)))
- gtk_rc_parse (gdm_config_get_string (GDM_KEY_GTKRC));
-
- gdm_gtk_theme = g_getenv ("GDM_GTK_THEME");
- if (ve_string_empty (gdm_gtk_theme))
- gdm_gtk_theme = gdm_config_get_string (GDM_KEY_GTK_THEME);
-
- if ( ! ve_string_empty (gdm_gtk_theme)) {
- gdm_set_theme (gdm_gtk_theme);
- }
-
- gdm_wm_screen_init (gdm_config_get_int (GDM_KEY_XINERAMA_SCREEN));
-
- r = verify_gdm_version ();
- if (r != 0)
- return r;
-
- /* Load the background as early as possible so GDM does not leave */
- /* the background unfilled. The cursor should be a watch already */
- /* but just in case */
- bg_color = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEMED_COLOR);
- /* If a graphical theme color does not exist fallback to the plain color */
- if (ve_string_empty (bg_color)) {
- bg_color = gdm_config_get_string (GDM_KEY_BACKGROUND_COLOR);
- }
- gdm_common_setup_background_color (bg_color);
- greeter_session_init ();
- greeter_language_initialize_model ();
-
- ve_signal_add (SIGHUP, greeter_reread_config, NULL);
-
- hup.sa_handler = ve_signal_notify;
- hup.sa_flags = 0;
- sigemptyset (&hup.sa_mask);
- sigaddset (&hup.sa_mask, SIGCHLD);
-
- if (sigaction (SIGHUP, &hup, NULL) < 0) {
- gdm_common_fail_greeter ("%s: Error setting up %s signal handler: %s", "main",
- "HUP", strerror (errno));
- }
-
- term.sa_handler = greeter_done;
- term.sa_flags = 0;
- sigemptyset (&term.sa_mask);
- sigaddset (&term.sa_mask, SIGCHLD);
-
- if G_UNLIKELY (sigaction (SIGINT, &term, NULL) < 0) {
- gdm_common_fail_greeter ("%s: Error setting up %s signal handler: %s", "main",
- "INT", strerror (errno));
- }
-
- if G_UNLIKELY (sigaction (SIGTERM, &term, NULL) < 0) {
- gdm_common_fail_greeter ("%s: Error setting up %s signal handler: %s", "main",
- "TERM", strerror (errno));
- }
-
- sigemptyset (&mask);
- sigaddset (&mask, SIGTERM);
- sigaddset (&mask, SIGHUP);
- sigaddset (&mask, SIGINT);
-
- if G_UNLIKELY (sigprocmask (SIG_UNBLOCK, &mask, NULL) == -1) {
- gdm_common_fail_greeter ("Could not set signal mask!");
- }
-
- /* ignore SIGCHLD */
- sigemptyset (&mask);
- sigaddset (&mask, SIGCHLD);
-
- if G_UNLIKELY (sigprocmask (SIG_BLOCK, &mask, NULL) == -1) {
- gdm_common_fail_greeter ("Could not set signal mask!");
- }
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-
- if G_UNLIKELY (DOING_GDM_DEVELOPMENT) {
- g_signal_connect (G_OBJECT (window), "key_press_event",
- G_CALLBACK (key_press_event), NULL);
- }
-
- canvas = gnome_canvas_new_aa ();
- GTK_WIDGET_UNSET_FLAGS (canvas, GTK_CAN_FOCUS);
- gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas),
- 0.0, 0.0,
- (double) gdm_wm_screen.width,
- (double) gdm_wm_screen.height);
- gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
- gtk_window_set_default_size (GTK_WINDOW (window),
- gdm_wm_screen.width,
- gdm_wm_screen.height);
- gtk_container_add (GTK_CONTAINER (window), canvas);
-
- /*
- * Initialize the value with the default value so the first time it
- * is displayed it doesn't show as 0. Also determine if the Halt,
- * Reboot, Suspend and Configurator commands work.
- */
- gdm_timed_delay = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
- GdmHaltFound = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_HALT));
- GdmRebootFound = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_REBOOT));
- GdmSuspendFound = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_SUSPEND));
- GdmConfiguratorFound = gdm_working_command_exists (gdm_config_get_string (GDM_KEY_CONFIGURATOR));
-
- GdmCustomCmdsFound = g_new0 (gboolean, GDM_CUSTOM_COMMAND_MAX);
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = NULL;
- /* For each possible custom command */
- key_string = g_strdup_printf(_("%s%d="), GDM_KEY_CUSTOM_CMD_TEMPLATE, i);
- GdmCustomCmdsFound[i] = gdm_working_command_exists (gdm_config_get_string (key_string));
- if (GdmCustomCmdsFound[i])
- GdmAnyCustomCmdsFound = TRUE;
-
- g_free (key_string);
- }
-
- if (g_getenv ("GDM_THEME") != NULL)
- gdm_graphical_theme = g_strdup (g_getenv ("GDM_THEME"));
- else if (gdm_config_get_bool (GDM_KEY_GRAPHICAL_THEME_RAND))
- gdm_graphical_theme = get_random_theme ();
- else
- gdm_graphical_theme = gdm_config_get_string (GDM_KEY_GRAPHICAL_THEME);
-
- theme_file = get_theme_file (gdm_graphical_theme, &theme_dir);
-
- error = NULL;
- root = greeter_parse (theme_file, theme_dir,
- GNOME_CANVAS (canvas),
- gdm_wm_screen.width,
- gdm_wm_screen.height,
- &error);
-
- if G_UNLIKELY (root == NULL)
- {
- GtkWidget *dialog;
- char *s;
- char *tmp;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- tmp = ve_filename_to_utf8 (ve_sure_string (gdm_graphical_theme));
- s = g_strdup_printf (_("There was an error loading the "
- "theme %s"), tmp);
- g_free (tmp);
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- s,
- (error && error->message) ? error->message : "");
- g_free (s);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- if (DOING_GDM_DEVELOPMENT)
- {
- exit (1);
- }
- }
-
- if G_UNLIKELY (error)
- g_clear_error (&error);
-
- /* Try circles.xml */
- if G_UNLIKELY (root == NULL)
- {
- g_free (theme_file);
- g_free (theme_dir);
- theme_file = get_theme_file ("circles", &theme_dir);
- root = greeter_parse (theme_file, theme_dir,
- GNOME_CANVAS (canvas),
- gdm_wm_screen.width,
- gdm_wm_screen.height,
- NULL);
- }
-
- g_free (theme_file);
-
- if G_UNLIKELY (root != NULL && greeter_lookup_id ("user-pw-entry") == NULL)
- {
- GtkWidget *dialog;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("The greeter theme is corrupt"),
- _("The theme does not contain "
- "definition for the username/password "
- "entry element."));
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- root = NULL;
- }
-
- /* FIXME: beter information should be printed */
- if G_UNLIKELY (DOING_GDM_DEVELOPMENT && root == NULL)
- {
- g_warning ("No theme could be loaded");
- exit (1);
- }
-
- if G_UNLIKELY (root == NULL)
- {
- GtkWidget *dialog;
-
- gdm_wm_init (0);
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("There was an error loading the "
- "theme, and the default theme "
- "could not be loaded. "
- "Attempting to start the "
- "standard greeter"),
- "");
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- execl (LIBEXECDIR "/gdmlogin", LIBEXECDIR "/gdmlogin", NULL);
- execlp ("gdmlogin", "gdmlogin", NULL);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("The GTK+ greeter could not be started. "
- "This display will abort and you may "
- "have to login another way and fix the "
- "installation of GDM"),
- "");
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
-
- _exit (DISPLAY_ABORT);
- }
-
- greeter_layout (root, GNOME_CANVAS (canvas));
-
- greeter_setup_items ();
-
- if G_LIKELY (! DOING_GDM_DEVELOPMENT) {
- ctrlch = g_io_channel_unix_new (STDIN_FILENO);
- g_io_channel_set_encoding (ctrlch, NULL, NULL);
- g_io_channel_set_buffered (ctrlch, TRUE);
- g_io_channel_set_flags (ctrlch,
- g_io_channel_get_flags (ctrlch) | G_IO_FLAG_NONBLOCK,
- NULL);
- g_io_add_watch (ctrlch,
- G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
- (GIOFunc) greeter_ctrl_handler,
- NULL);
- g_io_channel_unref (ctrlch);
- }
-
- gdm_common_setup_blinking ();
-
- gtk_widget_show_all (window);
- gtk_window_move (GTK_WINDOW (window), gdm_wm_screen.x, gdm_wm_screen.y);
- gtk_widget_show_now (window);
-
- greeter_item_ulist_unset_selected_user ();
- greeter_item_ulist_enable ();
- greeter_item_ulist_check_show_userlist ();
-
- /* can it ever happen that it'd be NULL here ??? */
- if G_UNLIKELY (window->window != NULL)
- {
- gdm_wm_init (GDK_WINDOW_XWINDOW (window->window));
-
- /* Run the focus, note that this will work no matter what
- * since gdm_wm_init will set the display to the gdk one
- * if it fails */
- gdm_wm_focus_window (GDK_WINDOW_XWINDOW (window->window));
- }
-
- if G_UNLIKELY (session_dir_whacked_out)
- {
- GtkWidget *dialog;
-
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Session directory is missing"),
- _("Your session directory is missing or empty! "
- "There are two available sessions you can use, but "
- "you should log in and correct the gdm configuration."));
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- }
-
- if G_UNLIKELY (g_getenv ("GDM_WHACKED_GREETER_CONFIG") != NULL)
- {
- GtkWidget *dialog;
-
- gdm_wm_focus_new_windows (TRUE);
-
- dialog = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Configuration is not correct"),
- _("The configuration file contains an invalid command "
- "line for the login dialog, so running the "
- "default command. Please fix your configuration."));
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- gdm_wm_no_login_focus_pop ();
- }
-
- /* if a flexiserver, reap self after some time */
- if (gdm_config_get_int (GDM_KEY_FLEXI_REAP_DELAY_MINUTES) > 0 &&
- ! ve_string_empty (g_getenv ("GDM_FLEXI_SERVER")) &&
- /* but don't reap Xnest flexis */
- ve_string_empty (g_getenv ("GDM_PARENT_DISPLAY")))
- {
- sid = g_signal_lookup ("activate",
- GTK_TYPE_MENU_ITEM);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("key_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("button_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- delay_reaping,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- last_reap_delay = time (NULL);
- g_timeout_add (60*1000, reap_flexiserver, NULL);
- }
-
- sid = g_signal_lookup ("event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_event,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- gdm_wm_restore_wm_order ();
-
- gdm_wm_show_info_msg_dialog (gdm_config_get_string (GDM_KEY_INFO_MSG_FILE),
- gdm_config_get_string (GDM_KEY_INFO_MSG_FONT));
-
- gdm_common_setup_cursor (GDK_LEFT_PTR);
- gdm_wm_center_cursor ();
- gdm_common_pre_fetch_launch ();
- gtk_main ();
-
- return 0;
-}
diff --git a/gui/greeter/greeter.dtd b/gui/greeter/greeter.dtd
deleted file mode 100644
index 77498028..00000000
--- a/gui/greeter/greeter.dtd
+++ /dev/null
@@ -1,78 +0,0 @@
-<!-- dtd for greeter -->
-<!ENTITY % colorattrs "file CDATA #IMPLIED
- color CDATA #IMPLIED
- font CDATA #IMPLIED
- tint CDATA #IMPLIED">
-<!ELEMENT greeter (item+)>
-<!ELEMENT item (pos | normal? | active? | prelight? | children? | show? | text? | fixed? | box? | listitem? | border?)*>
-<!ELEMENT children (item+)>
-<!ELEMENT pos EMPTY>
-<!ELEMENT show EMPTY>
-<!ELEMENT text (#PCDATA)>
-<!ELEMENT normal EMPTY>
-<!ELEMENT active EMPTY>
-<!ELEMENT prelight EMPTY>
-<!ELEMENT stock EMPTY>
-<!ELEMENT fixed (item+)>
-<!ELEMENT box (item+)>
-<!ELEMENT listitem (text+)>
-<!-- additional elements-->
-<!ELEMENT border EMPTY>
-
-<!-- internal id's are one of (user-pw-entry | caps-lock-warning | clock | pam-error | pam-message | pam-prompt | pam-warning | timed-label | language_button | disconnect_button | reboot_button | halt_button | session_button | suspend_button | system_button | config_button | chooser_button | userlist)
- but there can be other id's -->
-<!ATTLIST item
- type (rect | entry | pixmap | label | svg | rect | list) #REQUIRED
- id CDATA #IMPLIED
- button (true | false) #IMPLIED
->
-<!ATTLIST pos
- x CDATA #IMPLIED
- y CDATA #IMPLIED
- anchor CDATA "c"
- width CDATA #IMPLIED
- height CDATA #IMPLIED
->
-<!ATTLIST normal
- %colorattrs;
- alpha CDATA #IMPLIED
->
-<!ATTLIST active
- %colorattrs;
- alpha CDATA #IMPLIED
->
-<!ATTLIST prelight
- %colorattrs;
- file CDATA #IMPLIED
->
-<!ATTLIST stock
- type (language | session | system | disconnect | quit | caps-lock-warning | timed-label | welcome-label | username-label | config | chooser) #REQUIRED
->
-<!ATTLIST box
- orientation (horizontal | vertical) "horizontal"
- spacing CDATA #IMPLIED
- xpadding CDATA #IMPLIED
- ypadding CDATA #IMPLIED
- min-width CDATA #IMPLIED
- min-height CDATA #IMPLIED
->
-<!-- console,console-fixed,console-flexi,remote-flexi,flexi,remote-->
-<!ATTLIST show
- modes CDATA #IMPLIED
- type (config | chooser | system | halt | reboot | suspend | timed) #IMPLIED
->
-<!ATTLIST text
- xml:lang CDATA #IMPLIED
->
-<!ATTLIST listitem
- id CDATA #REQUIRED
->
-
-<!-- <border red="0" green="0" blue="10" alpha="255"/>-->
-
-<!ATTLIST border
- red CDATA #IMPLIED
- green CDATA #IMPLIED
- blue CDATA #IMPLIED
- alpha CDATA #IMPLIED
->
diff --git a/gui/greeter/greeter.h b/gui/greeter/greeter.h
deleted file mode 100644
index 8be51441..00000000
--- a/gui/greeter/greeter.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_H__
-#define __GREETER_H__
-
-#include <gtk/gtk.h>
-
-extern gboolean DOING_GDM_DEVELOPMENT;
-extern GtkWidget *canvas;
-extern GtkWidget *window;
-
-extern gboolean greeter_probably_login_prompt;
-
-void greeter_ignore_buttons (gboolean val);
-
-#endif
diff --git a/gui/greeter/greeter_action_language.c b/gui/greeter/greeter_action_language.c
deleted file mode 100644
index 0e2c7982..00000000
--- a/gui/greeter/greeter_action_language.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <string.h>
-
-#include "gdm.h"
-#include "gdmwm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "gdmlanguages.h"
-
-#include "greeter.h"
-#include "greeter_configuration.h"
-#include "greeter_item_pam.h"
-#include "greeter_action_language.h"
-#include "greeter_parser.h"
-#include "greeter_item_customlist.h"
-
-#define LAST_LANGUAGE "Last"
-#define DEFAULT_LANGUAGE "Default"
-
-static GtkWidget *tv = NULL;
-static GtkListStore *lang_model = NULL;
-static GtkWidget *dialog = NULL;
-static gchar *current_language = NULL;
-static gchar *dialog_selected_language = NULL;
-static gint savelang = GTK_RESPONSE_NO;
-
-GtkListStore *
-greeter_language_get_model (void)
-{
- return lang_model;
-}
-
-void
-greeter_language_initialize_model (void)
-{
- GList *list, *li;
- GtkTreeIter iter;
-
- list = gdm_lang_read_locale_file (gdm_config_get_string (GDM_KEY_LOCALE_FILE));
-
- lang_model = gtk_list_store_new (NUM_COLUMNS,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
-
- gtk_list_store_append (lang_model, &iter);
- gtk_list_store_set (lang_model, &iter,
- TRANSLATED_NAME_COLUMN, _("Last language"),
- UNTRANSLATED_NAME_COLUMN, NULL,
- LOCALE_COLUMN, LAST_LANGUAGE,
- -1);
-
- gtk_list_store_append (lang_model, &iter);
- gtk_list_store_set (lang_model, &iter,
- TRANSLATED_NAME_COLUMN, _("System Default"),
- UNTRANSLATED_NAME_COLUMN, NULL,
- LOCALE_COLUMN, DEFAULT_LANGUAGE,
- -1);
-
- for (li = list; li != NULL; li = li->next)
- {
- char *lang = li->data;
- char *name;
- char *untranslated;
-
- li->data = NULL;
-
- name = gdm_lang_name (lang,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- FALSE /* untranslated */,
- FALSE /* markup */);
-
- untranslated = gdm_lang_untranslated_name (lang,
- TRUE /* markup */);
-
- gtk_list_store_append (lang_model, &iter);
- gtk_list_store_set (lang_model, &iter,
- TRANSLATED_NAME_COLUMN, name,
- UNTRANSLATED_NAME_COLUMN, untranslated,
- LOCALE_COLUMN, lang,
- -1);
-
- g_free (name);
- g_free (untranslated);
- g_free (lang);
- }
- g_list_free (list);
-}
-
-gint
-greeter_language_get_save_language (void)
-{
- return savelang;
-}
-
-gchar *
-greeter_language_get_language (const char *old_language)
-{
- gchar *retval = NULL;
-
- /* Don't save language unless told otherwise */
- savelang = GTK_RESPONSE_NO;
-
- if (old_language == NULL)
- old_language = "";
-
- /* If a different language is selected */
- if (current_language != NULL && strcmp (current_language, LAST_LANGUAGE) != 0)
- {
- if (strcmp (current_language, DEFAULT_LANGUAGE) == 0)
- retval = g_strdup ("");
- else
- retval = g_strdup (current_language);
-
- /* User's saved language is not the chosen one */
- if (strcmp (old_language, retval) != 0)
- {
- gchar *primary_message;
- gchar *secondary_message;
- char *current_name, *saved_name;
-
- if (strcmp (current_language, DEFAULT_LANGUAGE) == 0)
- current_name = g_strdup (_("System Default"));
- else
- current_name = gdm_lang_name (current_language,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- TRUE /* untranslated */,
- TRUE /* markup */);
- if (strcmp (old_language, "") == 0)
- saved_name = g_strdup (_("System Default"));
- else
- saved_name = gdm_lang_name (old_language,
- FALSE /* never_encoding */,
- TRUE /* no_group */,
- TRUE /* untranslated */,
- TRUE /* markup */);
-
- primary_message = g_strdup_printf (_("Do you wish to make %s the default for future sessions?"),
- current_name);
- secondary_message = g_strdup_printf (_("You have chosen %s for this session, but your default setting is "
- "%s."), current_name, saved_name);
- g_free (current_name);
- g_free (saved_name);
-
- savelang = gdm_wm_query_dialog (primary_message, secondary_message,
- _("Make _Default"), _("Just For _This Session"), TRUE);
- g_free (primary_message);
- g_free (secondary_message);
- }
- }
- else
- {
- retval = g_strdup (old_language);
- }
-
- return retval;
-}
-
-static void
-selection_changed (GtkTreeSelection *selection,
- gpointer data)
-{
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected (selection, NULL, &iter))
- {
- g_free (dialog_selected_language);
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter, LOCALE_COLUMN, &dialog_selected_language, -1);
- }
-}
-
-static void
-tree_row_activated (GtkTreeView *view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- gpointer data)
-{
- GtkTreeIter iter;
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL (lang_model), &iter, path))
- {
- g_free (dialog_selected_language);
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter,
- LOCALE_COLUMN, &dialog_selected_language,
- -1);
- gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
- }
-}
-
-static void
-greeter_language_setup_treeview (void)
-{
- if (dialog == NULL)
- {
- GtkWidget *main_vbox;
- GtkWidget *button;
- GtkWidget **tmp_p;
- GtkWidget *swindow;
- GtkWidget *label;
- char *s;
-
- dialog = gtk_dialog_new_with_buttons (_("Select a Language"),
-#ifdef TODO
- GTK_WINDOW (parent_window),
-#endif
- NULL,
- 0,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL,
- NULL);
-
- button = gtk_button_new_with_mnemonic (_("Change _Language"));
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
- GTK_RESPONSE_OK);
-
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
-
- main_vbox = gtk_vbox_new (FALSE, 6);
- gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- main_vbox, TRUE, TRUE, 0);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK);
- /* evil gcc warnings */
- tmp_p = &dialog;
- g_object_add_weak_pointer (G_OBJECT (dialog), (gpointer *)tmp_p);
- s = g_strdup (_("_Select the language for your session to use:"));
- label = gtk_label_new_with_mnemonic (s);
- gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
- g_free (s);
- gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_box_pack_start (GTK_BOX (main_vbox),
- label, FALSE, FALSE, 0);
- tv = gtk_tree_view_new ();
- gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (tv), TRUE);
- gtk_label_set_mnemonic_widget (GTK_LABEL (label), tv);
- /* FIXME: we should handle this better, but things really look
- * bad if we aren't always LTR */
- gtk_widget_set_direction (tv, GTK_TEXT_DIR_LTR);
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv), FALSE);
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
- GTK_DIALOG_MODAL,
- NULL,
- gtk_cell_renderer_text_new (),
- "text", TRANSLATED_NAME_COLUMN,
- NULL);
- gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (tv),
- GTK_DIALOG_MODAL,
- NULL,
- gtk_cell_renderer_text_new (),
- "markup",
- UNTRANSLATED_NAME_COLUMN,
- NULL);
- swindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swindow), GTK_SHADOW_IN);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swindow),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (swindow), tv);
- gtk_box_pack_start (GTK_BOX (main_vbox),
- swindow, TRUE, TRUE, 0);
- gtk_window_set_default_size (GTK_WINDOW (dialog),
- MIN (400, gdm_wm_screen.width),
- MIN (600, gdm_wm_screen.height));
- g_signal_connect (G_OBJECT (gtk_tree_view_get_selection (GTK_TREE_VIEW (tv))),
- "changed",
- (GCallback) selection_changed,
- NULL);
- g_signal_connect (G_OBJECT (tv),
- "row_activated",
- (GCallback) tree_row_activated,
- NULL);
- gtk_tree_view_set_model (GTK_TREE_VIEW (tv),
- GTK_TREE_MODEL (lang_model));
- }
-}
-
-void
-greeter_language_set (char *language)
-{
- char *locale;
- GtkTreeSelection *selection;
- GtkTreeIter iter = {0};
-
- g_free (current_language);
- current_language = g_strdup (language);
-
- if (dialog == NULL)
- greeter_language_setup_treeview ();
-
- if (language == NULL)
- return;
-
- greeter_custom_set_language (language);
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
- gtk_tree_selection_unselect_all (selection);
-
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (lang_model), &iter)) {
- do {
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter, LOCALE_COLUMN, &locale, -1);
- if (locale != NULL && strcmp (locale, language) == 0) {
- GtkTreePath *path = gtk_tree_model_get_path (GTK_TREE_MODEL (lang_model), &iter);
-
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tv), path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- break;
- }
- } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (lang_model), &iter));
- }
-}
-
-/*
- * The button with this handler appears in the F10 menu, so it
- * cannot depend on callback data being passed in.
- */
-void
-greeter_language_handler (GreeterItemInfo *info, gpointer user_data)
-{
- if (dialog == NULL)
- greeter_language_setup_treeview ();
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- if (tv != NULL)
- {
- GtkTreeSelection *selection;
-
- gtk_widget_show_now (dialog);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
- if (selection == NULL)
- gtk_tree_selection_select_path (selection, gtk_tree_path_new_first ());
- else
- {
- GtkTreeIter iter;
- GtkTreePath *path;
- GtkTreeModel *tm = GTK_TREE_MODEL (lang_model);
-
- gtk_tree_selection_get_selected (selection, &tm, &iter);
- path = gtk_tree_model_get_path (GTK_TREE_MODEL (lang_model), &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tv), path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- }
- }
- switch (gtk_dialog_run (GTK_DIALOG (dialog)))
- {
- case GTK_RESPONSE_OK:
- if (dialog_selected_language)
- greeter_language_set ((char *) dialog_selected_language);
- break;
- case GTK_RESPONSE_CANCEL:
- default:
- break;
- }
-
- gdm_wm_no_login_focus_pop ();
-
- if (dialog)
- gtk_widget_hide (dialog);
-}
-
diff --git a/gui/greeter/greeter_action_language.h b/gui/greeter/greeter_action_language.h
deleted file mode 100644
index 26e30fe5..00000000
--- a/gui/greeter/greeter_action_language.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_ACTION_LANGUAGE_H__
-#define __GREETER_ACTION_LANGUAGE_H__
-
-#include "greeter_item.h"
-
-enum {
- LOCALE_COLUMN,
- TRANSLATED_NAME_COLUMN,
- UNTRANSLATED_NAME_COLUMN,
- NUM_COLUMNS
-};
-
-void greeter_language_initialize_model (void);
-gint greeter_language_get_save_language (void);
-gchar *greeter_language_get_language (const char *old_language);
-void greeter_language_handler (GreeterItemInfo *info,
- gpointer user_data);
-GtkListStore *greeter_language_get_model (void);
-void greeter_language_set (char *language);
-#endif
-
diff --git a/gui/greeter/greeter_canvas_item.c b/gui/greeter/greeter_canvas_item.c
deleted file mode 100644
index 68a7fac8..00000000
--- a/gui/greeter/greeter_canvas_item.c
+++ /dev/null
@@ -1,769 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <math.h>
-#include <string.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <librsvg/rsvg.h>
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "greeter.h"
-#include "greeter_item.h"
-#include "greeter_events.h"
-#include "greeter_system.h"
-#include "greeter_canvas_item.h"
-#include "greeter_configuration.h"
-#include "greeter_canvas_text.h"
-#include "greeter_parser.h"
-
-/* Keep track of buttons so they can be set sensitive/insensitive */
-GtkButton *gtk_ok_button = NULL;
-GtkButton *gtk_start_again_button = NULL;
-
-static void
-apply_tint (GdkPixbuf *pixbuf, guint32 tint_color)
-{
- guchar *pixels;
- guint r, g, b;
- gboolean has_alpha;
- guint w, h, stride;
- guint pixel_stride;
- guchar *line;
- int i;
-
- pixels = gdk_pixbuf_get_pixels (pixbuf);
- has_alpha = gdk_pixbuf_get_has_alpha (pixbuf);
-
- r = (tint_color & 0xff0000) >> 16;
- g = (tint_color & 0x00ff00) >> 8;
- b = (tint_color & 0x0000ff);
-
- w = gdk_pixbuf_get_width (pixbuf);
- h = gdk_pixbuf_get_height (pixbuf);
- stride = gdk_pixbuf_get_rowstride (pixbuf);
-
- pixel_stride = (has_alpha) ? 4 : 3;
-
- while (h-->0)
- {
- line = pixels;
-
- for (i = 0; i < w; i++)
- {
- line[0] = line[0] * r / 0xff;
- line[1] = line[1] * g / 0xff;
- line[2] = line[2] * b / 0xff;
- line += pixel_stride;
- }
-
- pixels += stride;
- }
-}
-
-static GdkPixbuf *
-transform_pixbuf (GdkPixbuf *orig,
- gboolean has_tint, guint32 tint_color,
- double alpha, gint width, gint height)
-{
- GdkPixbuf *scaled;
- gint p_width, p_height;
-
- p_width = gdk_pixbuf_get_width (orig);
- p_height = gdk_pixbuf_get_height (orig);
-
- if (p_width != width ||
- p_height != height ||
- alpha < 1.0 ||
- has_tint)
- {
- int alpha_i;
-
- if (alpha >= 1.0)
- alpha_i = 0xff;
- else if (alpha <= 0.0)
- alpha_i = 0;
- else
- alpha_i = (guint) floor (0xff*alpha);
- if (alpha != 0xff)
- {
- scaled = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, width, height);
- gdk_pixbuf_fill (scaled, 0);
- gdk_pixbuf_composite (orig, scaled, 0, 0, width, height,
- 0, 0, (double)width/p_width, (double)height/p_height,
- GDK_INTERP_BILINEAR, alpha_i);
- }
- else
- scaled = gdk_pixbuf_scale_simple (orig, width, height, GDK_INTERP_BILINEAR);
- }
- else
- scaled = g_object_ref (orig);
-
- if (has_tint)
- apply_tint (scaled, tint_color);
-
- return scaled;
-}
-
-static void
-activate_button (GtkWidget *widget, gpointer data)
-{
- const char *id = data;
- if (id != NULL)
- greeter_item_run_action_callback (id);
-}
-
-static void
-menubar_done (GtkMenuShell *menushell, gpointer data)
-{
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
-
- gtk_widget_grab_focus (entry);
-}
-
-static GtkWidget *
-make_menubar (void)
-{
- GtkWidget *w, *menu;
- GtkWidget *menubar = gtk_menu_bar_new ();
-
- /* FIXME: add translatable string here */
- w = gtk_menu_item_new_with_label ("Menu");
- gtk_menu_shell_append (GTK_MENU_SHELL (menubar), w);
- gtk_widget_show (GTK_WIDGET (w));
-
- menu = gtk_menu_new ();
- gtk_menu_item_set_submenu (GTK_MENU_ITEM (w), menu);
-
- w = gtk_menu_item_new_with_mnemonic (_("Select _Language..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (activate_button),
- "language_button");
-
- w = gtk_menu_item_new_with_mnemonic (_("Select _Session..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (activate_button),
- "session_button");
-
- greeter_system_append_system_menu (menu);
-
- /* Add a quit/disconnect item when in xdmcp mode or flexi mode */
- /* Do note that the order is important, we always want "Quit" for
- * flexi, even if not local (non-local xnest). and Disconnect
- * only for xdmcp */
- if ( ! ve_string_empty (g_getenv ("GDM_FLEXI_SERVER"))) {
- w = gtk_menu_item_new_with_mnemonic (_("_Quit"));
- } else if (ve_string_empty (g_getenv ("GDM_IS_LOCAL"))) {
- w = gtk_menu_item_new_with_mnemonic (_("D_isconnect"));
- } else {
- w = NULL;
- }
- if (w != NULL) {
- GtkWidget *sep;
- /* add separator before the quit */
- sep = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
- gtk_widget_show (GTK_WIDGET (sep));
-
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (gtk_main_quit), NULL);
- }
-
- g_signal_connect (G_OBJECT(gtk_menu_item_get_submenu(
- gtk_container_get_children(GTK_CONTAINER(menubar))->data)), "selection-done", G_CALLBACK (menubar_done), NULL);
-
- return menubar;
-}
-
-static void
-get_gdk_color_from_rgb (GdkColor *c, guint32 rgb)
-{
- c->red = ((rgb & 0xff0000) >> 16) * 0x101;
- c->green = ((rgb & 0xff00) >> 8) * 0x101;
- c->blue = (rgb & 0xff) * 0x101;
- c->pixel = 0;
-}
-
-static void
-menu_position_func (GtkMenu *menu,
- int *x,
- int *y,
- gboolean *push_in,
- GreeterItemInfo *item)
-{
- GtkAllocation rect;
- GtkRequisition requisition;
-
- rect = item->allocation;
- gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
- *x = rect.x;
- if (requisition.height <= rect.y)
- *y = rect.y - requisition.height;
- else
- *y = rect.y + rect.height;
-
- *push_in = TRUE;
-}
-
-/*
- * The button with this handler never appears in the F10 menu, so
- * it can make use of callback data.
- */
-static void
-greeter_options_handler (GreeterItemInfo *item, GtkWidget *menubar)
-{
- gtk_menu_popup (GTK_MENU(gtk_menu_item_get_submenu(
- gtk_container_get_children(GTK_CONTAINER(menubar))->data)),
- NULL, NULL, (GtkMenuPositionFunc)menu_position_func,
- item, 0, gtk_get_current_event_time());
-}
-
-static void
-greeter_item_run_button_action_callback (GtkButton *button, const char *id)
-{
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
-
- greeter_item_run_action_callback (id);
- gtk_widget_grab_focus (entry);
-}
-
-void
-greeter_item_create_canvas_item (GreeterItemInfo *item)
-{
- GnomeCanvasGroup *group;
- GtkJustification just;
- GtkWidget *entry;
- GtkWidget *gtkbutton;
- GtkWidget *list;
- GtkWidget *swin;
- double x1, y1, x2, y2;
- int i;
- GtkAllocation rect;
- char *text;
- GtkTooltips *tooltips;
- char *num_locale;
- GdkColor c;
-
- if (item->item != NULL)
- return;
-
- if ( ! greeter_item_is_visible (item))
- return;
-
- g_assert (item->parent->group_item);
-
- if (item->fixed_children != NULL ||
- item->box_children != NULL)
- {
- item->group_item =
- (GnomeCanvasGroup *)gnome_canvas_item_new (item->parent->group_item,
- GNOME_TYPE_CANVAS_GROUP,
- "x", (gdouble) 0.0,
- "y", (gdouble) 0.0,
- NULL);
- group = item->group_item;
- }
- else
- group = item->parent->group_item;
-
- rect = item->allocation;
-
-
- x1 = (gdouble) rect.x;
- y1 = (gdouble) rect.y;
- x2 = (gdouble) rect.x + rect.width;
- y2 = (gdouble) rect.y + rect.height;
-
- switch (item->item_type) {
- case GREETER_ITEM_TYPE_RECT:
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_RECT,
- "x1", x1,
- "y1", y1,
- "x2", x2,
- "y2", y2,
- "fill_color_rgba", item->data.rect.colors[GREETER_ITEM_STATE_NORMAL],
- NULL);
- break;
- case GREETER_ITEM_TYPE_SVG:
- num_locale = g_strdup (setlocale (LC_NUMERIC, NULL));
- setlocale (LC_NUMERIC, "C");
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if (item->data.pixmap.files[i] != NULL)
- {
- if (i > 0 &&
- item->data.pixmap.files[0] != NULL &&
- item->data.pixmap.pixbufs[0] != NULL &&
- strcmp (item->data.pixmap.files[0], item->data.pixmap.files[i]) == 0)
- item->data.pixmap.pixbufs[i] = g_object_ref (item->data.pixmap.pixbufs[0]);
- else
- item->data.pixmap.pixbufs[i] =
- gdk_pixbuf_new_from_file_at_size (item->data.pixmap.files[i], rect.width, rect.height, NULL);
- }
- else
- item->data.pixmap.pixbufs[i] = NULL;
- }
- setlocale (LC_NUMERIC, num_locale);
- g_free (num_locale);
- num_locale = NULL;
-
- /* Fall through */
- case GREETER_ITEM_TYPE_PIXMAP:
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- GdkPixbuf *pb = item->data.pixmap.pixbufs[i];
- if (pb != NULL)
- {
- item->data.pixmap.pixbufs[i] =
- transform_pixbuf (pb,
- (item->data.pixmap.have_tint & (1<<i)), item->data.pixmap.tints[i],
- (double)item->data.pixmap.alphas[i] / 256.0, rect.width, rect.height);
- g_object_unref (pb);
- }
- }
-
- if (item->data.pixmap.pixbufs[GREETER_ITEM_STATE_NORMAL] != NULL)
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_PIXBUF,
- "x", (gdouble) x1,
- "y", (gdouble) y1,
- "pixbuf", item->data.pixmap.pixbufs[GREETER_ITEM_STATE_NORMAL],
- NULL);
- break;
- case GREETER_ITEM_TYPE_LABEL:
- text = gdm_common_expand_text (item->data.text.orig_text);
-
- /* Justification is taken from the anchor */
- if (item->anchor == GTK_ANCHOR_NORTH_WEST ||
- item->anchor == GTK_ANCHOR_SOUTH_WEST ||
- item->anchor == GTK_ANCHOR_WEST)
- just = GTK_JUSTIFY_LEFT;
- else if (item->anchor == GTK_ANCHOR_NORTH_EAST ||
- item->anchor == GTK_ANCHOR_SOUTH_EAST ||
- item->anchor == GTK_ANCHOR_EAST)
- just = GTK_JUSTIFY_RIGHT;
- else
- just = GTK_JUSTIFY_CENTER;
-
- item->item = gnome_canvas_item_new (group,
- GREETER_TYPE_CANVAS_TEXT,
- "text", "",
- "x", x1,
- "y", y1,
- "anchor", item->anchor,
- "font_desc", item->data.text.fonts[GREETER_ITEM_STATE_NORMAL],
- "fill_color_rgba", item->data.text.colors[GREETER_ITEM_STATE_NORMAL],
- "justification", just,
- NULL);
-
- greeter_canvas_item_break_set_string (item,
- text,
- TRUE /* markup */,
- item->data.text.real_max_width,
- NULL /* width */,
- NULL /* height */,
- NULL /* canvas */,
- item->item);
- g_free (text);
-
- /* if there is an accelerator we do an INCREDIBLE hack */
- if (strchr (item->data.text.orig_text, '_') != NULL)
- {
- GreeterItemInfo *button;
- GtkWidget *fake_button = gtk_button_new_with_mnemonic (item->data.text.orig_text);
- gtk_widget_show (fake_button);
- GTK_WIDGET_UNSET_FLAGS (fake_button, GTK_CAN_FOCUS);
- gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", fake_button,
- "x", (double)-999.0,
- "y", (double)-999.0,
- "height", (double)20.0,
- "width", (double)20.0,
- NULL);
- button = item->my_button;
- if (button == NULL)
- button = item;
- g_signal_connect_data (G_OBJECT (fake_button), "clicked",
- G_CALLBACK (activate_button),
- g_strdup (button->id),
- (GClosureNotify)g_free,
- 0 /* connect_flags */);
- }
-
- break;
-
- case GREETER_ITEM_TYPE_BUTTON:
- gtkbutton = gtk_button_new_with_mnemonic (item->data.text.orig_text);
- gtk_widget_set_name (gtkbutton, item->id);
- if (strcmp (ve_sure_string (item->id), "ok_button") == 0) {
- gtk_ok_button = GTK_BUTTON (gtkbutton);
- } else if (strcmp (ve_sure_string (item->id), "cancel_button") == 0) {
- gtk_start_again_button = GTK_BUTTON (gtkbutton);
- }
-
- g_signal_connect (G_OBJECT (gtkbutton), "clicked",
- G_CALLBACK (greeter_item_run_button_action_callback),
- item->id);
-
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", gtkbutton,
- "x", x1,
- "y", y1,
- "height", (double)rect.height,
- "width", (double)rect.width,
- NULL);
-
- break;
-
- case GREETER_ITEM_TYPE_ENTRY:
- entry = gtk_entry_new ();
- gtk_widget_set_name (entry, "user-pw-entry");
- gtk_entry_set_has_frame (GTK_ENTRY (entry), FALSE);
-
- if (gdm_config_get_bool (GDM_KEY_ENTRY_INVISIBLE))
- gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0);
- else if (gdm_config_get_bool (GDM_KEY_ENTRY_CIRCLES))
- gtk_entry_set_invisible_char (GTK_ENTRY (entry), 0x25cf);
-
- gtk_widget_modify_font (entry, item->data.text.fonts[GREETER_ITEM_STATE_NORMAL]);
-
- get_gdk_color_from_rgb (&c, item->data.text.colors[GREETER_ITEM_STATE_NORMAL]);
- gtk_widget_modify_text (entry, GTK_STATE_NORMAL, &c);
-
- if (item->id != NULL && strcmp (item->id, "user-pw-entry") == 0) {
- /* HACK! Add a menubar, this is kind of evil isn't it,
- * should probably be done in the pam item setup thingie.
- * but this is really widget kind of thing. I dunno where
- * this belongs but it's a hack here. */
- GtkWidget *menubar = make_menubar ();
-
- gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", menubar,
- "x", (double)x1,
- "y", (double)y1,
- "height", (double)rect.height,
- "width", (double)rect.width,
- NULL);
-
- greeter_item_register_action_callback ("options_button",
- (ActionFunc)greeter_options_handler,
- menubar);
-
- /* Here add a tooltip, so that the user knows about F10 */
- tooltips = gtk_tooltips_new ();
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (entry),
- _("Answer questions here and press Enter "
- "when done. For a menu press F10."),
- NULL);
-
- /* FIXME: how to make this accessible??? */
- }
-
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", entry,
- "x", x1,
- "y", y1,
- "height", (double)rect.height,
- "width", (double)rect.width,
- NULL);
-
- /* cursor blinking is evil on remote displays, don't do it forever */
- gdm_common_setup_blinking_entry (entry);
-
- break;
-
- case GREETER_ITEM_TYPE_LIST:
- /* Note a list type must be setup later and we will add the list store
- * to it then, depending on the type. Likely userlist is the
- * only type we support */
-
- if (item->data.list.combo_type) {
- list = gtk_combo_box_new_text ();
-
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", list,
- "x", x1,
- "y", y1,
- "height", (double)rect.height,
- "width", (double)rect.width,
- NULL);
- } else {
- list = gtk_tree_view_new ();
-
- swin = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (swin),
- GTK_SHADOW_NONE);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (swin),
- GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (swin), list);
-
- item->item = gnome_canvas_item_new (group,
- GNOME_TYPE_CANVAS_WIDGET,
- "widget", swin,
- "x", x1,
- "y", y1,
- "height", (double)rect.height,
- "width", (double)rect.width,
- NULL);
- }
-
- break;
- }
-
- if (item->item_type == GREETER_ITEM_TYPE_RECT ||
- item->item_type == GREETER_ITEM_TYPE_SVG ||
- item->item_type == GREETER_ITEM_TYPE_PIXMAP ||
- item->item_type == GREETER_ITEM_TYPE_LABEL)
- g_signal_connect (G_OBJECT (item->item), "event",
- G_CALLBACK (greeter_item_event_handler),
- item);
-}
-
-/* This is so evil it hurts */
-static char *
-make_ugly_long_string_with_line_breaks (const char *orig)
-{
- const char *p;
- int n_chars, i;
- GString *foo = g_string_new (NULL);
- gboolean in_element = FALSE;
-
- n_chars = g_utf8_strlen (orig, -1);
- p = orig;
-
- i = 0;
- while (i < n_chars) {
- gunichar ch = g_utf8_get_char (p);
- if (ch == '<')
- in_element = TRUE;
- else if (ch == '>')
- in_element = FALSE;
- g_string_append_unichar (foo, ch);
- if ( ! in_element)
- g_string_append_unichar (foo, '\n');
- p = g_utf8_next_char (p);
- i++;
- }
-
- return g_string_free (foo, FALSE);
-}
-
-/* This function is very VERY evil */
-static gboolean
-append_word (GString *str, GString *line, GString *word, const char *after, int max_width, const char *textattr, GnomeCanvasItem *canvas_item)
-{
- int width, height;
- char *post = make_ugly_long_string_with_line_breaks (after);
- char *try = g_strconcat (str->str, word->str, "\n", post, NULL);
- g_free (post);
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (canvas_item), textattr, try, NULL);
- g_free (try);
-
- pango_layout_get_pixel_size (GNOME_CANVAS_TEXT (canvas_item)->layout, &width, &height);
-
- if (width > max_width) {
- if ( ! ve_string_empty (line->str)) {
- if (str->len > 0 &&
- str->str[str->len-1] == ' ') {
- g_string_truncate (str, str->len-1);
- }
- g_string_append_unichar (str, '\n');
- }
- g_string_assign (line, word->str);
- g_string_append (str, word->str);
- g_string_assign (word, "");
-
- return TRUE;
- } else {
- g_string_append (line, word->str);
- g_string_append (str, word->str);
- g_string_assign (word, "");
-
- return FALSE;
- }
-}
-
-/* This function is very VERY evil */
-/* Note that it should just use pango and do all the right things rather then
- the utter hacks it tries to do. But I couldn't figure out how to do this
- simply with pango and how to interact with markup properly (it seems easy
- to do if there is no markup */
-void
-greeter_canvas_item_break_set_string (GreeterItemInfo *info,
- const char *orig,
- gboolean markup,
- int max_width,
- int *width,
- int *height,
- GnomeCanvas *canvas,
- GnomeCanvasItem *real_item)
-{
- PangoLogAttr *attrs;
- int n_chars;
- GString *str;
- GString *word;
- GString *line;
- int i;
- int n_attrs;
- int ia;
- const char *p;
- int in_current_row;
- GnomeCanvasItem *canvas_item;
- const char *textattr;
- int lwidth, lheight;
-
- str = g_string_new (NULL);
- word = g_string_new (NULL);
- line = g_string_new (NULL);
-
- /* avoid errors and even possible crashes */
- if (markup && ! pango_parse_markup (orig, -1, 0, NULL, NULL, NULL, NULL)) {
- markup = FALSE;
- }
-
- textattr = markup ? "markup" : "text";
-
- /* A gross hack */
- if (real_item != NULL)
- canvas_item = real_item;
- else
- canvas_item = gnome_canvas_item_new (gnome_canvas_root (canvas),
- GREETER_TYPE_CANVAS_TEXT,
- textattr, "",
- "x", 0.0,
- "y", 0.0,
- "font_desc", info->data.text.fonts[GREETER_ITEM_STATE_NORMAL],
- NULL);
-
- if (max_width == 0) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (canvas_item), textattr, orig, NULL);
- pango_layout_get_pixel_size (GNOME_CANVAS_TEXT (canvas_item)->layout, width, height);
-
- if (real_item != canvas_item) {
- gtk_object_destroy (GTK_OBJECT (canvas_item));
- g_string_free (line, TRUE);
- g_string_free (word, TRUE);
- g_string_free (str, TRUE);
- }
- return;
- }
-
- n_chars = g_utf8_strlen (orig, -1);
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (canvas_item), textattr, orig, NULL);
- pango_layout_get_pixel_size (GNOME_CANVAS_TEXT (canvas_item)->layout, &lwidth, &lheight);
- if (lwidth <= max_width) {
- if (width != NULL)
- *width = lwidth;
- if (height != NULL)
- *height = lheight;
- if (real_item != canvas_item) {
- gtk_object_destroy (GTK_OBJECT (canvas_item));
- g_string_free (line, TRUE);
- g_string_free (word, TRUE);
- g_string_free (str, TRUE);
- }
- return;
- }
-
- pango_layout_get_log_attrs (GNOME_CANVAS_TEXT (canvas_item)->layout, &attrs, &n_attrs);
-
- i = 0;
- ia = 0;
- in_current_row = 0;
- p = orig;
- while (i < n_chars) {
- gunichar ch;
-
- ch = g_utf8_get_char (p);
-
- if (markup && ch == '<') {
- while (i < n_chars) {
- g_string_append_unichar (word, ch);
- p = g_utf8_next_char (p);
- i++;
-
- if (ch == '>') {
- ch = g_utf8_get_char (p);
- break;
- } else {
- ch = g_utf8_get_char (p);
- }
- }
- if (i >= n_chars)
- break;
- }
-
- if (attrs[ia].is_line_break && in_current_row > 0) {
- if (append_word (str, line, word, p, max_width, textattr, canvas_item))
- in_current_row = 0;
- }
-
- in_current_row++;
- g_string_append_unichar (word, ch);
-
- p = g_utf8_next_char (p);
- i++;
- ia++;
-
- /* eeek! */
- if (ia >= n_attrs) {
- while (i < n_chars) {
- ch = g_utf8_get_char (p);
- g_string_append_unichar (word, ch);
- p = g_utf8_next_char (p);
- i++;
- }
- break;
- }
- }
-
- if ( ! ve_string_empty (word->str))
- append_word (str, line, word, "", max_width, textattr, canvas_item);
-
- gnome_canvas_item_set (GNOME_CANVAS_ITEM (canvas_item), textattr, str->str, NULL);
- pango_layout_get_pixel_size (GNOME_CANVAS_TEXT (canvas_item)->layout, width, height);
-
- if (real_item != canvas_item)
- gtk_object_destroy (GTK_OBJECT (canvas_item));
- g_free (attrs);
-
- g_string_free (line, TRUE);
- g_string_free (word, TRUE);
-
- g_string_free (str, TRUE);
-}
-
diff --git a/gui/greeter/greeter_canvas_item.h b/gui/greeter/greeter_canvas_item.h
deleted file mode 100644
index cbea3eef..00000000
--- a/gui/greeter/greeter_canvas_item.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_CANVAS_ITEM_H
-#define GREETER_CANVAS_ITEM_H
-
-void greeter_item_create_canvas_item (GreeterItemInfo *item);
-
-void greeter_canvas_item_break_set_string (GreeterItemInfo *info,
- const char *orig,
- gboolean markup,
- int max_width,
- int *width,
- int *height,
- GnomeCanvas *canvas,
- GnomeCanvasItem *real_item);
-
-#endif /* GREETER_CANVAS_ITEM_H */
diff --git a/gui/greeter/greeter_canvas_text.c b/gui/greeter/greeter_canvas_text.c
deleted file mode 100644
index 961f5190..00000000
--- a/gui/greeter/greeter_canvas_text.c
+++ /dev/null
@@ -1,213 +0,0 @@
-#include <string.h>
-
-#include "greeter_canvas_text.h"
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-text.h>
-#include <pango/pangoft2.h>
-
-
-enum
-{
- PROP_0,
- PROP_TEXT,
- PROP_MARKUP
-};
-
-static void greeter_canvas_text_class_init (GreeterCanvasTextClass *class);
-static void greeter_canvas_text_init (GreeterCanvasText *text);
-static void greeter_canvas_text_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec);
-static void greeter_canvas_text_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec);
-
-G_DEFINE_TYPE (GreeterCanvasText, greeter_canvas_text, GNOME_TYPE_CANVAS_TEXT)
-
-static void
-greeter_canvas_text_class_init (GreeterCanvasTextClass *greeter_class)
-{
- GObjectClass *gobject_class;
-
- gobject_class = G_OBJECT_CLASS (greeter_class);
-
- gobject_class->set_property = greeter_canvas_text_set_property;
- gobject_class->get_property = greeter_canvas_text_get_property;
-
- g_object_class_install_property
- (gobject_class,
- PROP_TEXT,
- g_param_spec_string ("text",
- "Text",
- "Text to render",
- NULL,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-
- g_object_class_install_property
- (gobject_class,
- PROP_MARKUP,
- g_param_spec_string ("markup",
- "Markup",
- "Markup to render",
- NULL,
- (G_PARAM_READABLE | G_PARAM_WRITABLE)));
-}
-
-static void
-greeter_canvas_text_init (GreeterCanvasText *text)
-{
-}
-
-static gdouble
-greeter_canvas_text_get_screen_dpi (GreeterCanvasText *text)
-{
- GdkDisplay *display;
- GdkScreen *screen;
- GdkAtom atom, type;
- gint resources_length;
- gchar *resources, *resource, *end;
- gdouble dpi;
- static const gdouble default_dpi = 96.0;
-
- atom = gdk_atom_intern ("RESOURCE_MANAGER", TRUE);
-
- if (atom == 0)
- return default_dpi;
-
- display =
- gtk_widget_get_display (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas));
-
- if (display == NULL)
- return default_dpi;
-
- screen =
- gtk_widget_get_screen (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas));
-
- if (screen == NULL)
- return default_dpi;
-
- gdk_error_trap_push ();
- if (!gdk_property_get (gdk_screen_get_root_window (screen),
- atom, GDK_TARGET_STRING,
- 0, G_MAXINT,
- FALSE,
- &type, NULL, &resources_length,
- (void *) &resources))
- {
- gdk_error_trap_pop ();
- return default_dpi;
- }
-
- gdk_display_sync (display);
- gdk_error_trap_pop ();
-
- if (type != GDK_TARGET_STRING)
- return default_dpi;
-
- if (resources == NULL)
- return default_dpi;
-
- resource = strstr (resources, "Xft.dpi:\t");
-
- if (resource == NULL)
- return default_dpi;
-
- resource += sizeof ("Xft.dpi:\t") - 1;
-
- dpi = strtod (resource, &end);
-
- g_assert (end != NULL);
-
- if ((end == resource) || (*end != '\n'))
- return default_dpi;
-
- g_free (resources);
-
- if (dpi < G_MINDOUBLE)
- return default_dpi;
-
- return dpi;
-}
-
-static void
-greeter_canvas_text_init_layout (GreeterCanvasText *greeter_item)
-{
- GnomeCanvasItem *item;
- GnomeCanvasText *text;
-
- PangoContext *gtk_context, *context;
- static PangoFT2FontMap *font_map;
- gdouble dpi;
-
- item = GNOME_CANVAS_ITEM (greeter_item);
- text = GNOME_CANVAS_TEXT (greeter_item);
-
- if (text->layout != NULL)
- return;
-
- gtk_context = gtk_widget_get_pango_context (GTK_WIDGET (item->canvas));
-
- if (font_map == NULL)
- {
- font_map = (PangoFT2FontMap *) pango_ft2_font_map_new ();
- dpi = greeter_canvas_text_get_screen_dpi (greeter_item);
- pango_ft2_font_map_set_resolution (font_map, dpi, dpi);
- }
-
- context = pango_ft2_font_map_create_context (font_map);
-
- pango_context_set_language (context,
- pango_context_get_language (gtk_context));
- pango_context_set_base_dir (context,
- pango_context_get_base_dir (gtk_context));
- pango_context_set_font_description (context,
- pango_context_get_font_description (gtk_context));
-
- text->layout = pango_layout_new (context);
- g_object_unref (context);
-}
-
-static void
-greeter_canvas_text_set_property (GObject *object,
- guint param_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- switch (param_id)
- {
- case PROP_TEXT:
- greeter_canvas_text_init_layout (GREETER_CANVAS_TEXT (object));
- g_object_set_property (object, "GnomeCanvasText::text", value);
- break;
- case PROP_MARKUP:
- greeter_canvas_text_init_layout (GREETER_CANVAS_TEXT (object));
- g_object_set_property (object, "GnomeCanvasText::markup", value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
-
-static void
-greeter_canvas_text_get_property (GObject *object,
- guint param_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (param_id)
- {
- case PROP_TEXT:
- g_object_get_property (object, "GnomeCanvasText::text", value);
- break;
- case PROP_MARKUP:
- g_object_get_property (object, "GnomeCanvasText::markup", value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, param_id, pspec);
- break;
- }
-}
diff --git a/gui/greeter/greeter_canvas_text.h b/gui/greeter/greeter_canvas_text.h
deleted file mode 100644
index f2131023..00000000
--- a/gui/greeter/greeter_canvas_text.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#ifndef GREETER_CANVAS_TEXT_H
-#define GREETER_CANVAS_TEXT_H
-
-#include <libgnomecanvas/gnome-canvas.h>
-#include <libgnomecanvas/gnome-canvas-text.h>
-
-G_BEGIN_DECLS
-
-#define GREETER_TYPE_CANVAS_TEXT (greeter_canvas_text_get_type ())
-#define GREETER_CANVAS_TEXT(obj) (GTK_CHECK_CAST ((obj), GREETER_TYPE_CANVAS_TEXT, GreeterCanvasText))
-#define GREETER_CANVAS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GREETER_TYPE_CANVAS_TEXT, GreeterCanvasTextClass))
-#define GREETER_IS_CANVAS_TEXT(obj) (GTK_CHECK_TYPE ((obj), GREETER_TYPE_CANVAS_TEXT))
-#define GREETER_IS_CANVAS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GREETER_TYPE_CANVAS_TEXT))
-#define GREETER_CANVAS_TEXT_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GREETER_TYPE_CANVAS_TEXT, GreeterCanvasTextClass))
-
-
-typedef struct _GreeterCanvasText GreeterCanvasText;
-typedef struct _GreeterCanvasTextClass GreeterCanvasTextClass;
-
-struct _GreeterCanvasText {
- GnomeCanvasText text;
-};
-
-struct _GreeterCanvasTextClass {
- GnomeCanvasTextClass parent_class;
-};
-
-
-GType greeter_canvas_text_get_type (void) G_GNUC_CONST;
-
-G_END_DECLS
-
-#endif
diff --git a/gui/greeter/greeter_configuration.h b/gui/greeter/greeter_configuration.h
deleted file mode 100644
index d4dabaf9..00000000
--- a/gui/greeter/greeter_configuration.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_CONFIGURATION_H
-#define GREETER_CONFIGURATION_H
-
-extern gboolean GdmUseCirclesInEntry;
-extern gboolean GdmUseInvisibleInEntry;
-extern gboolean GdmShowGnomeFailsafeSession;
-extern gboolean GdmShowXtermFailsafeSession;
-extern gboolean GdmShowLastSession;
-extern gboolean GdmSystemMenu;
-extern gboolean GdmConfigAvailable;
-extern gboolean GdmChooserButton;
-extern gchar *GdmHalt;
-extern gchar *GdmReboot;
-extern gchar *GdmSuspend;
-extern gchar *GdmConfigurator;
-extern gboolean GdmHaltFound;
-extern gboolean GdmRebootFound;
-extern gboolean GdmCustomCmdFound;
-extern gboolean *GdmCustomCmdsFound;
-extern gboolean GdmAnyCustomCmdsFound;
-extern gboolean GdmSuspendFound;
-extern gboolean GdmConfiguratorFound;
-extern gchar *GdmSessionDir;
-extern gchar *GdmDefaultSession;
-extern gchar *GdmDefaultLocale;
-extern gchar *GdmLocaleFile;
-extern gboolean GdmTimedLoginEnable;
-extern gboolean GdmUse24Clock;
-extern gchar *GdmTimedLogin;
-extern gint GdmTimedLoginDelay;
-extern gchar *GdmGlobalFaceDir;
-extern gchar *GdmDefaultFace;
-extern gint GdmIconMaxHeight;
-extern gint GdmIconMaxWidth;
-extern gchar *GdmExclude;
-extern int GdmMinimalUID;
-extern gboolean GdmAllowRoot;
-extern gboolean GdmAllowRemoteRoot;
-extern gchar *GdmWelcome;
-extern gchar *GdmServAuthDir;
-extern gchar *GdmInfoMsgFile;
-extern gchar *GdmInfoMsgFont;
-extern gchar *GdmSoundProgram;
-extern gchar *GdmSoundOnLoginReadyFile;
-extern gchar *GdmSoundOnLoginSuccessFile;
-extern gchar *GdmSoundOnLoginFailureFile;
-extern gboolean GdmSoundOnLoginReady;
-extern gboolean GdmSoundOnLoginSuccess;
-extern gboolean GdmSoundOnLoginFailure;
-
-extern gboolean GDM_IS_LOCAL;
-extern gboolean DOING_GDM_DEVELOPMENT;
-
-#endif /* GREETER_CONFIGURATION_H */
diff --git a/gui/greeter/greeter_dialogs.c b/gui/greeter/greeter_dialogs.c
deleted file mode 100644
index ceb4c1ac..00000000
--- a/gui/greeter/greeter_dialogs.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "greeter_dialogs.h"
-
-
-GtkWidget *
-greeter_lang_dialog (void)
-{
-}
diff --git a/gui/greeter/greeter_dialogs.h b/gui/greeter/greeter_dialogs.h
deleted file mode 100644
index c2f3e7f7..00000000
--- a/gui/greeter/greeter_dialogs.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_DIALOGS_H__
-#define __GREETER_DIALOGS_H__
-
-#include <gtk/gtk.h>
-
-GtkWidget *greeter_lang_dialog (void);
-
-#endif
diff --git a/gui/greeter/greeter_events.c b/gui/greeter/greeter_events.c
deleted file mode 100644
index 34b96040..00000000
--- a/gui/greeter/greeter_events.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "greeter_item.h"
-#include "greeter_parser.h"
-#include "greeter_events.h"
-
-struct CallbackInfo {
- ActionFunc func;
- gpointer user_data;
-};
-
-static GHashTable *callback_hash = NULL;
-
-static void
-state_run (GreeterItemInfo *info,
- GreeterItemState old_state)
-{
- if (info->state != old_state &&
- info->have_state & (1<<(info->state)) &&
- info->have_state != (1<<GREETER_ITEM_STATE_NORMAL) &&
- info->item != NULL)
- {
- if (GREETER_ITEM_TYPE_IS_PIXMAP (info) &&
- info->data.pixmap.pixbufs[info->state] != NULL)
- gnome_canvas_item_set (info->item,
- "pixbuf", info->data.pixmap.pixbufs[info->state],
- NULL);
- if ((GREETER_ITEM_TYPE_IS_TEXT (info) ||
- GREETER_ITEM_TYPE_IS_RECT (info)) &&
- info->data.rect.have_color & (1<<(info->state)))
- gnome_canvas_item_set (info->item,
- "fill_color_rgba", info->data.rect.colors[info->state],
- NULL);
- if (GREETER_ITEM_TYPE_IS_TEXT (info) &&
- info->data.text.fonts[info->state] != NULL)
- gnome_canvas_item_set (info->item,
- "font_desc", info->data.text.fonts[info->state],
- NULL);
- }
-}
-
-static void propagate_state (GreeterItemInfo *info,
- GreeterItemState old_state);
-
-static void
-propagate_state_foreach (gpointer data, gpointer user_data)
-{
- GreeterItemInfo *info = data;
- GreeterItemState state = GPOINTER_TO_INT (user_data);
- GreeterItemState old_state;
-
- old_state = info->state;
- info->state = state;
-
- propagate_state (info, old_state);
-}
-
-static void
-propagate_state (GreeterItemInfo *info,
- GreeterItemState old_state)
-{
- state_run (info, old_state);
-
- g_list_foreach (info->fixed_children, propagate_state_foreach,
- GINT_TO_POINTER ((int) info->state));
- g_list_foreach (info->box_children, propagate_state_foreach,
- GINT_TO_POINTER ((int) info->state));
-}
-
-static void propagate_reset_state (GreeterItemInfo *info,
- GreeterItemState old_state);
-
-static void
-propagate_reset_state_foreach (gpointer data, gpointer user_data)
-{
- GreeterItemInfo *info = data;
- GreeterItemState old_state;
-
- old_state = info->state;
- info->state = info->base_state;
-
- propagate_state (info, old_state);
-}
-
-static void
-propagate_reset_state (GreeterItemInfo *info,
- GreeterItemState old_state)
-{
- state_run (info, old_state);
-
- g_list_foreach (info->fixed_children, propagate_reset_state_foreach, NULL);
- g_list_foreach (info->box_children, propagate_reset_state_foreach, NULL);
-}
-
-void
-greeter_item_run_action_callback (const char *id)
-{
- struct CallbackInfo *cb_info;
- GreeterItemInfo *info;
-
- g_return_if_fail (id != NULL);
-
- if G_UNLIKELY (callback_hash == NULL)
- return;
-
- info = greeter_lookup_id (id);
- cb_info = g_hash_table_lookup (callback_hash, id);
-
- /*
- * If run_action_callback gets called and there is no
- * callback function registered, don't try to call it.
- * This can happen because the button_release event
- * tries calling the callback function for any
- * item that has an id (like the Username field).
- */
- if (cb_info)
- (*cb_info->func) (info, cb_info->user_data);
-}
-
-gint
-greeter_item_event_handler (GnomeCanvasItem *item,
- GdkEvent *event,
- gpointer data)
-{
- GreeterItemState old_state;
- GreeterItemInfo *info;
- GreeterItemInfo *button;
-
- info = data;
- button = info->my_button;
- if (button != NULL && button != info)
- {
- /* FIXME: this is a hack, we have not really left the container,
- * but the container gets a stupid leave event and
- * we send it an enter event back, it does two event propagations
- * one of them is pointless. */
- /* if this is a button, fake an event on the button */
- return greeter_item_event_handler (button->item,
- event,
- button);
- }
-
- old_state = info->state;
-
- switch (event->type) {
- case GDK_ENTER_NOTIFY:
- info->mouse_over = TRUE;
- break;
-
- case GDK_LEAVE_NOTIFY:
- info->mouse_over = FALSE;
- break;
-
- case GDK_BUTTON_PRESS:
- info->mouse_down = TRUE;
- break;
-
- case GDK_BUTTON_RELEASE:
- info->mouse_down = FALSE;
-
- if (info->mouse_over && info->id && callback_hash)
- greeter_item_run_action_callback (info->id);
-
- /* Make sure entry has focus if a type BUTTON has been pressed. */
- if (info->item_type == GREETER_ITEM_TYPE_BUTTON) {
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
-
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- /* Make sure entry has focus after button press */
- gtk_widget_grab_focus (entry);
- }
- }
-
- break;
-
- default:
- break;
- }
-
- if (info->mouse_over)
- {
- if (info->mouse_down)
- info->state = GREETER_ITEM_STATE_ACTIVE;
- else
- info->state = GREETER_ITEM_STATE_PRELIGHT;
- }
- else
- info->state = GREETER_ITEM_STATE_NORMAL;
-
- info->base_state = info->state;
-
- if (info->state != old_state)
- {
- if (info->canvasbutton)
- {
- if (info->state == GREETER_ITEM_STATE_NORMAL)
- propagate_reset_state (info, old_state);
- else
- propagate_state (info, old_state);
- }
- else
- state_run (info, old_state);
- }
-
- return FALSE;
-}
-
-void
-greeter_item_register_action_callback (char *id,
- ActionFunc func,
- gpointer user_data)
-{
- struct CallbackInfo *info;
-
- if G_UNLIKELY (callback_hash == NULL)
- callback_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
-
- info = g_new (struct CallbackInfo, 1);
-
- info->func = func;
- info->user_data = user_data;
-
- g_hash_table_insert (callback_hash,
- g_strdup (id),
- info);
-}
-
diff --git a/gui/greeter/greeter_events.h b/gui/greeter/greeter_events.h
deleted file mode 100644
index 1c1ba1d7..00000000
--- a/gui/greeter/greeter_events.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_EVENTS_H
-#define GREETER_EVENTS_H
-
-typedef void (*ActionFunc) (GreeterItemInfo *info,
- gpointer user_data);
-
-gint greeter_item_event_handler (GnomeCanvasItem *item,
- GdkEvent *event,
- gpointer data);
-
-void greeter_item_register_action_callback (char *id,
- ActionFunc func,
- gpointer user_data);
-
-void greeter_item_run_action_callback (const char *id);
-
-#endif /* GREETER_EVENTS_H */
diff --git a/gui/greeter/greeter_geometry.c b/gui/greeter/greeter_geometry.c
deleted file mode 100644
index 265b19be..00000000
--- a/gui/greeter/greeter_geometry.c
+++ /dev/null
@@ -1,623 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <librsvg/rsvg.h>
-#include "gdmcommon.h"
-#include "gdmwm.h"
-#include "greeter_geometry.h"
-#include "greeter_canvas_item.h"
-
-static void greeter_item_size_request (GreeterItemInfo *item,
- GtkRequisition *requisition_out,
- gint parent_width,
- gint parent_height,
- GnomeCanvas *canvas);
-static void greeter_size_allocate_fixed (GreeterItemInfo *fixed,
- GList *items,
- GnomeCanvas *canvas);
-static void greeter_size_allocate_box (GreeterItemInfo *box,
- GList *items,
- GnomeCanvas *canvas,
- GtkAllocation *allocation);
-static void fixup_from_anchor (GtkAllocation *rect,
- GtkAnchorType anchor);
-static void update_real_max_width (GreeterItemInfo *info,
- int max_width);
-
-static void
-update_real_max_width (GreeterItemInfo *info, int max_width)
-{
- if (info->data.text.real_max_width == 0 ||
- info->data.text.real_max_width > max_width)
- info->data.text.real_max_width = max_width;
-}
-
-
-/* Position the item */
-static void
-greeter_item_size_allocate (GreeterItemInfo *item,
- GtkAllocation *allocation,
- GnomeCanvas *canvas)
-{
- item->allocation = *allocation;
-
- if ( ! greeter_item_is_visible (item))
- return;
-
- if (item->item == NULL)
- greeter_item_create_canvas_item (item);
-
- if (item->fixed_children)
- greeter_size_allocate_fixed (item,
- item->fixed_children,
- canvas);
-
- if (item->box_children)
- greeter_size_allocate_box (item,
- item->box_children,
- canvas,
- allocation);
-
-}
-
-static void
-fixup_from_anchor (GtkAllocation *rect,
- GtkAnchorType anchor)
-{
- switch (anchor)
- {
- case GTK_ANCHOR_NW:
- break;
- case GTK_ANCHOR_N:
- rect->x -= rect->width/2;
- break;
- case GTK_ANCHOR_NE:
- rect->x -= rect->width;
- break;
-
- case GTK_ANCHOR_W:
- rect->y -= rect->height/2;
- break;
- case GTK_ANCHOR_CENTER:
- rect->x -= rect->width/2;
- rect->y -= rect->height/2;
- break;
- case GTK_ANCHOR_E:
- rect->x -= rect->width;
- rect->y -= rect->height/2;
- break;
-
- case GTK_ANCHOR_SW:
- rect->y -= rect->height;
- break;
- case GTK_ANCHOR_S:
- rect->x -= rect->width/2;
- rect->y -= rect->height;
- break;
- case GTK_ANCHOR_SE:
- rect->x -= rect->width;
- rect->y -= rect->height;
- break;
- default:
- break;
- }
-}
-
-/* Position the children of the parent given
- * the size */
-static void
-greeter_size_allocate_fixed (GreeterItemInfo *fixed,
- GList *items,
- GnomeCanvas *canvas)
-{
- GList *l;
- GreeterItemInfo *child;
- GtkRequisition requisition;
- GtkAllocation child_allocation;
-
- l = items;
- while (l != NULL)
- {
- child = l->data;
- l = l->next;
-
- if ( ! greeter_item_is_visible (child))
- continue;
-
- greeter_item_size_request (child,
- &requisition,
- fixed->allocation.width,
- fixed->allocation.height,
- canvas);
-
- child_allocation.x = fixed->allocation.x;
- child_allocation.y = fixed->allocation.y;
-
- child_allocation.width = requisition.width;
- child_allocation.height = requisition.height;
-
- if (child->x_type == GREETER_ITEM_POS_ABSOLUTE)
- child_allocation.x += ( ! child->x_negative) ? child->x : fixed->allocation.width + child->x;
- else if (child->x_type == GREETER_ITEM_POS_RELATIVE)
- child_allocation.x += fixed->allocation.width * child->x / 100.0;
-
- if (child->y_type == GREETER_ITEM_POS_ABSOLUTE)
- child_allocation.y += ( ! child->y_negative) ? child->y : fixed->allocation.height + child->y;
- else if (child->y_type == GREETER_ITEM_POS_RELATIVE)
- child_allocation.y += fixed->allocation.height * child->y / 100.0;
-
- if (child->item_type != GREETER_ITEM_TYPE_LABEL)
- fixup_from_anchor (&child_allocation, child->anchor);
-
- greeter_item_size_allocate (child,
- &child_allocation,
- canvas);
- }
-}
-
-
-/* Position the children of the parent given
- * the size */
-static void
-greeter_size_allocate_box (GreeterItemInfo *box,
- GList *items,
- GnomeCanvas *canvas,
- GtkAllocation *allocation)
-{
- GreeterItemInfo *child;
- GList *children;
- GtkAllocation child_allocation;
- GtkRequisition child_requisition;
- gint nvis_children;
- gint nexpand_children;
- gint child_major_size;
- gint major_size;
- gint extra;
- gint major;
- gint w, h;
-
- nvis_children = 0;
- nexpand_children = 0;
-
- children = items;
- while (children)
- {
- child = children->data;
- children = children->next;
-
- if (greeter_item_is_visible (child))
- {
- nvis_children += 1;
- if (child->expand)
- nexpand_children += 1;
- }
- }
-
- if (nvis_children > 0)
- {
- if (box->box_orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- if (box->box_homogeneous)
- {
- major_size = (allocation->width -
- box->box_x_padding * 2 -
- (nvis_children - 1) * box->box_spacing);
- extra = major_size / nvis_children;
- }
- else if (nexpand_children > 0)
- {
- major_size = (gint) allocation->width - (gint) box->requisition.width;
- extra = major_size / nexpand_children;
- }
- else
- {
- major_size = 0;
- extra = 0;
- }
-
- major = allocation->x + box->box_x_padding;
- }
- else
- {
- if (box->box_homogeneous)
- {
- major_size = (allocation->height -
- box->box_y_padding * 2 -
- (nvis_children - 1) * box->box_spacing);
- extra = major_size / nvis_children;
- }
- else if (nexpand_children > 0)
- {
- major_size = (gint) allocation->height - (gint) box->requisition.height;
- extra = major_size / nexpand_children;
- }
- else
- {
- major_size = 0;
- extra = 0;
- }
-
- major = allocation->y + box->box_y_padding;
- }
-
-
- children = items;
- while (children)
- {
- child = children->data;
- children = children->next;
-
- if ( ! greeter_item_is_visible (child))
- continue;
-
- if (box->box_homogeneous)
- {
- if (nvis_children == 1)
- child_major_size = major_size;
- else
- child_major_size = extra;
-
- major_size -= extra;
-
- nvis_children -= 1;
- }
- else
- {
- greeter_item_size_request (child,
- &child_requisition,
- 0, 0, canvas);
-
- if (box->box_orientation == GTK_ORIENTATION_HORIZONTAL)
- child_major_size = child_requisition.width;
- else
- child_major_size = child_requisition.height;
-
- if (child->expand)
- {
- if (nexpand_children == 1)
- child_major_size += major_size;
- else
- child_major_size += extra;
-
- nexpand_children -= 1;
- major_size -= extra;
- }
- }
-
- /* Dirty the child requisition, since
- * we now know the right parent size.
- */
- child->has_requisition = FALSE;
- w = (box->box_orientation == GTK_ORIENTATION_HORIZONTAL) ? child_major_size : allocation->width - 2 * box->box_x_padding;
- h = (box->box_orientation == GTK_ORIENTATION_HORIZONTAL) ? allocation->height - 2 * box->box_y_padding : child_major_size;
-
- greeter_item_size_request (child,
- &child_requisition,
- w, h, canvas);
-
- child_allocation.width = child_requisition.width;
- child_allocation.height = child_requisition.height;
-
- if (box->box_orientation == GTK_ORIENTATION_VERTICAL &&
- child->item_type == GREETER_ITEM_TYPE_LABEL) {
- update_real_max_width (child, allocation->width);
- }
-
- if (box->box_orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- child_allocation.x = major;
- child_allocation.y = allocation->y + box->box_y_padding;
- }
- else
- {
- child_allocation.x = allocation->x + box->box_x_padding;
- child_allocation.y = major;
- }
-
- if (child->x_type == GREETER_ITEM_POS_ABSOLUTE)
- child_allocation.x += ( ! child->x_negative) ? child->x : w + child->x;
- else if (child->x_type == GREETER_ITEM_POS_RELATIVE)
- child_allocation.x += w * child->x / 100.0;
-
- if (child->y_type == GREETER_ITEM_POS_ABSOLUTE)
- child_allocation.y += ( ! child->y_negative) ? child->y : h + child->y;
- else if (child->y_type == GREETER_ITEM_POS_RELATIVE)
- child_allocation.y += h * child->y / 100.0;
-
- if (child->item_type != GREETER_ITEM_TYPE_LABEL)
- fixup_from_anchor (&child_allocation, child->anchor);
-
- if (child_allocation.x + child_allocation.width > allocation->x + allocation->width)
- child_allocation.width -= (child_allocation.x + child_allocation.width
- - allocation->x - allocation->width);
-
- greeter_item_size_allocate (child,
- &child_allocation,
- canvas);
-
- major += child_major_size + box->box_spacing;
- }
- }
-}
-
-static void
-greeter_size_request_box (GreeterItemInfo *box,
- GtkRequisition *requisition,
- GnomeCanvas *canvas)
-{
-
- GreeterItemInfo *child;
- GtkRequisition child_requisition;
- GList *children;
- gint nvis_children;
-
- requisition->width = 0;
- requisition->height = 0;
-
- nvis_children = 0;
-
- children = box->box_children;
- while (children)
- {
- child = children->data;
- children = children->next;
-
- if ( ! greeter_item_is_visible (child))
- continue;
-
- greeter_item_size_request (child,
- &child_requisition,
- 0, 0, canvas);
-
- if (box->box_orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- if (box->box_homogeneous)
- {
- requisition->width = MAX (requisition->width,
- child_requisition.width);
- }
- else
- {
- requisition->width += child_requisition.width;
- }
-
- requisition->height = MAX (requisition->height, child_requisition.height);
- }
- else
- {
- if (box->box_homogeneous)
- {
- requisition->height = MAX (requisition->height,
- child_requisition.height);
- }
- else
- {
- requisition->height += child_requisition.height;
- }
-
- requisition->width = MAX (requisition->width, child_requisition.width);
- }
-
-
- nvis_children += 1;
- }
-
- if (nvis_children > 0)
- {
-
- if (box->box_orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- if (box->box_homogeneous)
- requisition->width *= nvis_children;
- requisition->width += (nvis_children - 1) * box->box_spacing;
- }
- else
- {
- if (box->box_homogeneous)
- requisition->height *= nvis_children;
- requisition->height += (nvis_children - 1) * box->box_spacing;
- }
- }
-
- requisition->width += box->box_x_padding * 2;
- requisition->height += box->box_y_padding * 2;
-
- requisition->width = MAX (requisition->width, box->box_min_width);
- requisition->height = MAX (requisition->height, box->box_min_height);
-}
-
-/* Calculate the requested minimum size of the item */
-static void
-greeter_item_size_request (GreeterItemInfo *item,
- GtkRequisition *requisition_out,
- gint parent_width,
- gint parent_height,
- GnomeCanvas *canvas)
-{
- GtkRequisition *req;
- GtkRequisition box_requisition = {0, 0};
- int set_width = 0;
- int set_height = 0;
-
- if (item->has_requisition)
- {
- *requisition_out = item->requisition;
- return;
- }
-
- req = &item->requisition;
-
- req->width = 0;
- req->height = 0;
-
- if (item->width_type == GREETER_ITEM_SIZE_BOX ||
- item->height_type == GREETER_ITEM_SIZE_BOX)
- {
- greeter_size_request_box (item,
- &box_requisition,
- canvas);
- }
-
- switch (item->width_type)
- {
- case GREETER_ITEM_SIZE_ABSOLUTE:
- set_width = (item->width > 0) ? item->width : parent_width + item->width;
- break;
- case GREETER_ITEM_SIZE_RELATIVE:
- set_width = item->width*parent_width / 100.0;
- break;
- case GREETER_ITEM_SIZE_BOX:
- set_width = box_requisition.width;
- break;
- case GREETER_ITEM_SIZE_SCALE:
- case GREETER_ITEM_SIZE_UNSET:
- break;
- }
-
- switch (item->height_type)
- {
- case GREETER_ITEM_SIZE_ABSOLUTE:
- set_height = (item->height > 0) ? item->height : parent_height + item->height;
- break;
- case GREETER_ITEM_SIZE_RELATIVE:
- set_height = item->height*parent_height / 100.0;
- break;
- case GREETER_ITEM_SIZE_BOX:
- set_height = box_requisition.height;
- break;
- case GREETER_ITEM_SIZE_SCALE:
- case GREETER_ITEM_SIZE_UNSET:
- break;
- }
-
- if (item->item_type == GREETER_ITEM_TYPE_LABEL)
- {
- int width, height;
- char *text;
- int max_width = G_MAXINT;
-
- /* This is not the ugly hack you're looking for.
- * You can go about your business.
- * Move Along
- */
- text = gdm_common_expand_text (item->data.text.orig_text);
-
- if (set_width > 0)
- max_width = set_width;
-
- if (item->data.text.max_width < max_width)
- max_width = item->data.text.max_width;
-
- if (item->data.text.max_screen_percent_width/100.0 * gdm_wm_screen.width < max_width)
- max_width = item->data.text.max_screen_percent_width/100.0 * gdm_wm_screen.width;
-
- greeter_canvas_item_break_set_string (item,
- text,
- TRUE /* markup */,
- max_width,
- &width,
- &height,
- canvas,
- NULL /* real_item */);
-
- req->width = width;
- req->height = height;
-
- g_free (text);
- }
-
- if (item->item_type == GREETER_ITEM_TYPE_PIXMAP)
- {
- req->width = gdk_pixbuf_get_width (item->data.pixmap.pixbufs[0]);
- req->height = gdk_pixbuf_get_height (item->data.pixmap.pixbufs[0]);
- }
-
- if (item->item_type == GREETER_ITEM_TYPE_SVG)
- {
- GdkPixbuf *svg;
-
- svg = rsvg_pixbuf_from_file (item->data.pixmap.files[0], NULL);
- req->width = gdk_pixbuf_get_width (svg);
- req->height = gdk_pixbuf_get_height (svg);
- g_object_unref (svg);
- }
-
- if (item->item_type == GREETER_ITEM_TYPE_BUTTON)
- {
-#define ITEM_BUTTON_MIN_RECOMMANDED_WIDTH_OFFSET 15
-#define ITEM_BUTTON_MIN_RECOMMANDED_HEIGHT_OFFSET 10
- PangoLayout *layout;
- int pango_width, pango_height;
- int pix_width, pix_height;
-
- GtkWidget *dummy_w = gtk_button_new ();
-
- layout = gtk_widget_create_pango_layout (dummy_w, item->data.text.orig_text);
-
- pango_layout_get_size (layout, &pango_width, &pango_height);
-
- pix_height = PANGO_PIXELS (pango_height) + ITEM_BUTTON_MIN_RECOMMANDED_HEIGHT_OFFSET;
- pix_width = PANGO_PIXELS (pango_width) + ITEM_BUTTON_MIN_RECOMMANDED_WIDTH_OFFSET;
-
- if (pix_width > item->parent->box_min_width)
- req->width = pix_width;
- else
- req->width = item->parent->box_min_width;
-
- if (pix_height > item->parent->box_min_height)
- req->height = pix_height;
- else
- req->height = item->parent->box_min_height;
- }
-
- if (req->width > 0 && req->height > 0)
- {
- if (item->width_type == GREETER_ITEM_SIZE_SCALE && set_height > 0)
- set_width = (req->width * set_height) / req->height;
- else if (item->height_type == GREETER_ITEM_SIZE_SCALE && set_width > 0)
- set_height = (req->height * set_width) / req->width;
- }
-
- if (set_width > 0)
- req->width = set_width;
- if (set_height > 0)
- req->height = set_height;
-
- *requisition_out = item->requisition;
- item->has_requisition = TRUE;
-}
-
-
-
-void
-greeter_layout (GreeterItemInfo *root_item,
- GnomeCanvas *canvas)
-{
- root_item->allocation.x = 0;
- root_item->allocation.y = 0;
- root_item->allocation.width = root_item->width;
- root_item->allocation.height = root_item->height;
-
- greeter_size_allocate_fixed (root_item,
- root_item->fixed_children,
- canvas);
-}
diff --git a/gui/greeter/greeter_geometry.h b/gui/greeter/greeter_geometry.h
deleted file mode 100644
index 182ef9e9..00000000
--- a/gui/greeter/greeter_geometry.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_GEOMETRY_H
-#define GREETER_GEOMETRY_H
-
-#include "greeter_item.h"
-
-void greeter_layout (GreeterItemInfo *root_item,
- GnomeCanvas *canvas);
-
-#endif
diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c
deleted file mode 100644
index 75a2b255..00000000
--- a/gui/greeter/greeter_item.c
+++ /dev/null
@@ -1,235 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-
-#include "gdm.h"
-#include "gdmconfig.h"
-#include "gdmcommon.h"
-#include "misc.h"
-
-#include "greeter_item.h"
-#include "greeter_configuration.h"
-
-extern gboolean GdmHaltFound;
-extern gboolean GdmRebootFound;
-extern gboolean GdmCustomCmdFound;
-extern gboolean *GdmCustomCmdsFound;
-extern gboolean GdmSuspendFound;
-extern gboolean GdmConfiguratorFound;
-
-GreeterItemInfo *
-greeter_item_info_new (GreeterItemInfo *parent,
- GreeterItemType type)
-{
- GreeterItemInfo *info;
- int i;
-
- info = g_new0 (GreeterItemInfo, 1);
-
- info->item_type = type;
- info->parent = parent;
-
- info->anchor = GTK_ANCHOR_NW;
- info->x_type = GREETER_ITEM_POS_UNSET;
- info->y_type = GREETER_ITEM_POS_UNSET;
- info->width_type = GREETER_ITEM_SIZE_UNSET;
- info->height_type = GREETER_ITEM_SIZE_UNSET;
-
- if (type != GREETER_ITEM_TYPE_LIST)
- {
- for (i=0; i< GREETER_ITEM_STATE_MAX; i++)
- {
- /* these happen to coincide for all
- items but list */
- info->data.rect.alphas[i] = 0xff;
- }
- }
-
- info->box_orientation = GTK_ORIENTATION_VERTICAL;
-
- info->state = GREETER_ITEM_STATE_NORMAL;
- info->base_state = GREETER_ITEM_STATE_NORMAL;
-
- info->show_modes = GREETER_ITEM_SHOW_EVERYWHERE;
-
- info->canvasbutton = FALSE;
- info->gtkbutton = FALSE;
-
- if (GREETER_ITEM_TYPE_IS_TEXT (info))
- {
- info->data.text.max_width = 0xffff;
- info->data.text.max_screen_percent_width = 90;
- info->data.text.real_max_width = 0;
- }
-
- return info;
-}
-
-void
-greeter_item_info_free (GreeterItemInfo *info)
-{
- int i;
- GList *list;
-
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if (GREETER_ITEM_TYPE_IS_PIXMAP (info))
- {
- if (info->data.pixmap.pixbufs[i] != NULL)
- g_object_unref (G_OBJECT (info->data.pixmap.pixbufs[i]));
- if (info->data.pixmap.files[i] != NULL)
- g_free (info->data.pixmap.files[i]);
- }
- else if (GREETER_ITEM_TYPE_IS_TEXT (info))
- {
- if (info->data.text.fonts[i] != NULL)
- pango_font_description_free (info->data.text.fonts[i]);
- }
- }
-
- list = info->fixed_children;
- info->fixed_children = NULL;
- g_list_foreach (list, (GFunc) greeter_item_info_free, NULL);
- g_list_free (list);
-
- list = info->box_children;
- info->box_children = NULL;
- g_list_foreach (list, (GFunc) greeter_item_info_free, NULL);
- g_list_free (list);
-
- if (GREETER_ITEM_TYPE_IS_TEXT (info))
- g_free (info->data.text.orig_text);
-
- /* FIXME: what about custom list items! */
-
- g_free (info->id);
- g_free (info->show_type);
-
- memset (info, 0, sizeof (GreeterItemInfo));
- g_free (info);
-}
-
-void
-greeter_item_update_text (GreeterItemInfo *info)
-{
- char *text;
- if (info && info->item &&
- GNOME_IS_CANVAS_TEXT (info->item) &&
- GREETER_ITEM_TYPE_IS_TEXT (info))
- {
- text = gdm_common_expand_text (info->data.text.orig_text);
-
- g_object_set (G_OBJECT (info->item),
- "markup", text,
- NULL);
-
- g_free (text);
- }
-
-}
-
-gboolean
-greeter_item_is_visible (GreeterItemInfo *info)
-{
- static gboolean checked = FALSE;
- static gboolean GDM_IS_LOCAL = FALSE;
- static gboolean GDM_FLEXI_SERVER = FALSE;
- gboolean sysmenu = FALSE;
- gint i = 0;
-
- if ( ! checked)
- {
- if (g_getenv ("GDM_IS_LOCAL") != NULL)
- GDM_IS_LOCAL = TRUE;
- if (g_getenv ("GDM_FLEXI_SERVER") != NULL)
- GDM_FLEXI_SERVER = TRUE;
- }
-
- if (GDM_IS_LOCAL && ! GDM_FLEXI_SERVER &&
- ! (info->show_modes & GREETER_ITEM_SHOW_CONSOLE_FIXED))
- return FALSE;
- if (GDM_IS_LOCAL && GDM_FLEXI_SERVER &&
- ! (info->show_modes & GREETER_ITEM_SHOW_CONSOLE_FLEXI))
- return FALSE;
- if ( ! GDM_IS_LOCAL && GDM_FLEXI_SERVER &&
- ! (info->show_modes & GREETER_ITEM_SHOW_REMOTE_FLEXI))
- return FALSE;
- if ( ! GDM_IS_LOCAL && ! GDM_FLEXI_SERVER &&
- ! (info->show_modes & GREETER_ITEM_SHOW_REMOTE))
- return FALSE;
-
- sysmenu = gdm_config_get_bool (GDM_KEY_SYSTEM_MENU);
-
- if (( ! gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE) ||
- gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES) ||
- ! sysmenu ||
- ! GdmConfiguratorFound) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "config") == 0))
- return FALSE;
-
- if (( ! gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON) || ! sysmenu) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "chooser") == 0))
- return FALSE;
-
- if ( ! sysmenu && info->show_type != NULL &&
- strcmp (info->show_type, "system") == 0)
- return FALSE;
-
- if (( ! sysmenu || ! GdmHaltFound) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "halt") == 0))
- return FALSE;
- if (( ! sysmenu || ! GdmRebootFound) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "reboot") == 0))
- return FALSE;
- if (( ! sysmenu || ! GdmSuspendFound) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "suspend") == 0))
- return FALSE;
-
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = g_strdup_printf (_("custom_cmd%d"), i);
- if (( ! sysmenu || ! GdmCustomCmdsFound[i]) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, key_string) == 0)) {
- g_free (key_string);
- return FALSE;
- }
- g_free (key_string);
- }
-
- if (( ! gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE) ||
- ve_string_empty (gdm_config_get_string (GDM_KEY_TIMED_LOGIN)) ||
- NULL == g_getenv("GDM_TIMED_LOGIN_OK")) &&
- (info->show_type != NULL &&
- strcmp (info->show_type, "timed") == 0))
- return FALSE;
-
- return TRUE;
-}
diff --git a/gui/greeter/greeter_item.h b/gui/greeter/greeter_item.h
deleted file mode 100644
index 1f6c9e0b..00000000
--- a/gui/greeter/greeter_item.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_ITEM_H
-#define GREETER_ITEM_H
-
-#include <libgnomecanvas/libgnomecanvas.h>
-
-typedef struct _GreeterItemInfo GreeterItemInfo;
-typedef struct _GreeterItemListItem GreeterItemListItem;
-typedef enum _GreeterItemState GreeterItemState;
-typedef enum _GreeterItemType GreeterItemType;
-typedef enum _GreeterItemSizeType GreeterItemSizeType;
-typedef enum _GreeterItemPosType GreeterItemPosType;
-typedef enum _GreeterItemShowModes GreeterItemShowModes;
-
-/* Make sure to adjust the bitfield in the structure if
- you make this larger */
-enum _GreeterItemState {
- GREETER_ITEM_STATE_NORMAL,
- GREETER_ITEM_STATE_PRELIGHT,
- GREETER_ITEM_STATE_ACTIVE,
- GREETER_ITEM_STATE_MAX
-};
-
-/* Make sure to adjust the bitfield in the structure if
- you make this larger */
-enum _GreeterItemType {
- GREETER_ITEM_TYPE_RECT,
- GREETER_ITEM_TYPE_SVG,
- GREETER_ITEM_TYPE_PIXMAP,
- GREETER_ITEM_TYPE_LABEL,
- GREETER_ITEM_TYPE_ENTRY,
- GREETER_ITEM_TYPE_LIST,
- GREETER_ITEM_TYPE_BUTTON
-};
-
-/* Make sure to adjust the bitfield in the structure if
- you make this larger */
-enum _GreeterItemSizeType {
- GREETER_ITEM_SIZE_UNSET,
- GREETER_ITEM_SIZE_ABSOLUTE,
- GREETER_ITEM_SIZE_RELATIVE,
- GREETER_ITEM_SIZE_BOX,
- GREETER_ITEM_SIZE_SCALE
-};
-
-/* Make sure to adjust the bitfield in the structure if
- you make this larger */
-enum _GreeterItemPosType {
- GREETER_ITEM_POS_UNSET,
- GREETER_ITEM_POS_ABSOLUTE,
- GREETER_ITEM_POS_RELATIVE
-};
-
-/* Make sure to adjust the bitfield in the structure if
- you make this larger */
-enum _GreeterItemShowModes {
- GREETER_ITEM_SHOW_EVERYWHERE = 0xf,
- GREETER_ITEM_SHOW_NOWHERE = 0,
- GREETER_ITEM_SHOW_CONSOLE_FIXED = 1<<0,
- GREETER_ITEM_SHOW_CONSOLE = (1<<0) | (1<<1),
- GREETER_ITEM_SHOW_CONSOLE_FLEXI = 1<<1,
- GREETER_ITEM_SHOW_REMOTE_FLEXI = 1<<2,
- GREETER_ITEM_SHOW_FLEXI = (1<<1) | (1<<2),
- GREETER_ITEM_SHOW_REMOTE = 1<<3
-};
-
-struct _GreeterItemInfo {
- GreeterItemInfo *parent;
-
- GtkAnchorType anchor;
- float x;
- float y;
- float width;
- float height;
- GreeterItemPosType x_type:2;
- GreeterItemPosType y_type:2;
- GreeterItemSizeType width_type:4;
- GreeterItemSizeType height_type:4;
- guint x_negative:1; /* needed for -0 */
- guint y_negative:1; /* needed for -0 */
-
- /* For packed items */
- guint expand:1;
-
- /* The item type */
- GreeterItemType item_type:4;
-
- GreeterItemShowModes show_modes:4;
-
- /* Runtime state: */
- GreeterItemState state:2;
- GreeterItemState base_state:2;
- guint mouse_down:1;
- guint mouse_over:1;
-
- /* box flags */
- guint box_homogeneous:1;
-
- /* is a canvas rectangle that acts like a button */
- /* (see the my_button comment) */
- guint canvasbutton:1;
-
- /* is a real GTK button (not the fake canvas button) */
- guint gtkbutton:1;
-
- /* geometry handling: */
- guint has_requisition:1;
- GtkRequisition requisition;
- GtkAllocation allocation;
-
- /* Button can propagate states and collect states from underlying items,
- * it should be a parent of this item */
- GreeterItemInfo *my_button;
-
- char *show_type; /* timed, system, config, chooser, halt, suspend, reboot */
-
- char *id;
-
- GList *box_children;
- GtkOrientation box_orientation;
- guint16 box_x_padding;
- guint16 box_y_padding;
- guint16 box_min_width;
- guint16 box_min_height;
- guint16 box_spacing;
-
- /* Container data */
- GList *fixed_children;
-
- union {
- /* Note: we want to have alphas, colors and have_color coincide for
- * all types that have it */
-#define GREETER_ITEM_TYPE_IS_TEXT(info) ((info)->item_type == GREETER_ITEM_TYPE_LABEL || (info)->item_type == GREETER_ITEM_TYPE_ENTRY)
- struct {
- guint8 alphas[GREETER_ITEM_STATE_MAX];
- guint32 colors[GREETER_ITEM_STATE_MAX];
-
- guint8 have_color; /* this is a bitfield since these are
- true/false values */
-
- PangoFontDescription *fonts[GREETER_ITEM_STATE_MAX];
- char *orig_text;
- guint16 max_width;
- guint8 max_screen_percent_width;
- guint16 real_max_width;
- } text; /* text and entry (entry only uses fonts) */
-
-#define GREETER_ITEM_TYPE_IS_PIXMAP(info) ((info)->item_type == GREETER_ITEM_TYPE_PIXMAP || (info)->item_type == GREETER_ITEM_TYPE_SVG)
- struct {
- guint8 alphas[GREETER_ITEM_STATE_MAX];
- guint32 tints[GREETER_ITEM_STATE_MAX];
- guint8 have_tint; /* this is a bitfield since these are
- true/false values */
-
- char *files[GREETER_ITEM_STATE_MAX];
- GdkPixbuf *pixbufs[GREETER_ITEM_STATE_MAX];
- } pixmap;
-
-#define GREETER_ITEM_TYPE_IS_LIST(info) ((info)->item_type == GREETER_ITEM_TYPE_LIST)
- struct {
- char *icon_color;
- char *label_color;
- /* If this is a custom list, then these are the items
- to pick from */
- GList *items;
- gboolean combo_type;
- } list;
-
-#define GREETER_ITEM_TYPE_IS_RECT(info) ((info)->item_type == GREETER_ITEM_TYPE_RECT)
- struct {
- guint8 alphas[GREETER_ITEM_STATE_MAX];
- guint32 colors[GREETER_ITEM_STATE_MAX];
-
- guint8 have_color; /* this is a bitfield since these are
- true/false values */
- } rect;
- } data;
-
- guint8 have_state; /* this is a bitfield since these are
- true/false values */
-
- /* Canvas data: */
- GnomeCanvasItem *item;
- GnomeCanvasGroup *group_item;
-};
-
-struct _GreeterItemListItem {
- char *id;
- char *text;
-};
-
-gint greeter_item_event_handler (GnomeCanvasItem *item,
- GdkEvent *event,
- gpointer data);
-
-GreeterItemInfo *greeter_item_info_new (GreeterItemInfo *parent,
- GreeterItemType type);
-void greeter_item_info_free (GreeterItemInfo *info);
-
-char *greeter_item_expand_text (const char *text);
-
-void greeter_item_update_text (GreeterItemInfo *info);
-
-gboolean greeter_item_is_visible (GreeterItemInfo *info);
-
-#endif /* GREETER_ITEM_H */
diff --git a/gui/greeter/greeter_item_capslock.c b/gui/greeter/greeter_item_capslock.c
deleted file mode 100644
index 385c0374..00000000
--- a/gui/greeter/greeter_item_capslock.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <gdk/gdkkeysyms.h>
-#include <string.h>
-#include <gdk/gdkx.h>
-#include <X11/XKBlib.h>
-
-#include "greeter_parser.h"
-#include "greeter_item_capslock.h"
-
-static gboolean caps_lock_state = FALSE;
-
-static Display *
-get_parent_display (void)
-{
- static gboolean tested = FALSE;
- static Display *dsp = NULL;
-
- if (tested)
- return dsp;
-
- tested = TRUE;
-
- if (g_getenv ("GDM_PARENT_DISPLAY") != NULL)
- {
- char *old_xauth = g_strdup (g_getenv ("XAUTHORITY"));
- if (g_getenv ("GDM_PARENT_XAUTHORITY") != NULL)
- {
- g_setenv ("XAUTHORITY",
- g_getenv ("GDM_PARENT_XAUTHORITY"), TRUE);
- }
- dsp = XOpenDisplay (g_getenv ("GDM_PARENT_DISPLAY"));
- if (old_xauth != NULL)
- g_setenv ("XAUTHORITY", old_xauth, TRUE);
- else
- g_unsetenv ("XAUTHORITY");
- g_free (old_xauth);
- }
-
- return dsp;
-}
-
-gboolean
-greeter_is_capslock_on (void)
-{
- XkbStateRec states;
- Display *dsp;
-
- /* HACK! incredible hack, if this is set we get
- * indicator state from the parent display, since we must be inside an
- * Xnest */
- dsp = get_parent_display ();
- if (dsp == NULL)
- dsp = GDK_DISPLAY ();
-
- if (XkbGetState (dsp, XkbUseCoreKbd, &states) != Success)
- return FALSE;
-
- return (states.locked_mods & LockMask) != 0;
-}
-
-
-static void
-capslock_update (gboolean new_state)
-{
- GreeterItemInfo *info;
- GnomeCanvasItem *item;
-
- caps_lock_state = new_state;
-
- info = greeter_lookup_id ("caps-lock-warning");
-
- if (info)
- {
- if (info->group_item != NULL)
- item = GNOME_CANVAS_ITEM (info->group_item);
- else
- item = info->item;
-
- if (caps_lock_state)
- {
- gnome_canvas_item_show (item);
- }
- else
- {
- gnome_canvas_item_hide (item);
- }
- }
-}
-
-static gboolean
-cl_key_press_event (GtkWidget *widget, GdkEventKey *key, gpointer data)
-{
- gboolean new_state;
-
- new_state = greeter_is_capslock_on ();
- if (new_state != caps_lock_state)
- capslock_update (new_state);
-
- return FALSE;
-}
-
-
-gboolean
-greeter_item_capslock_setup (GtkWidget *window)
-{
- capslock_update (greeter_is_capslock_on ());
-
- g_signal_connect (G_OBJECT (window), "key_press_event",
- G_CALLBACK (cl_key_press_event), NULL);
- return TRUE;
-}
-
diff --git a/gui/greeter/greeter_item_capslock.h b/gui/greeter/greeter_item_capslock.h
deleted file mode 100644
index 089ce591..00000000
--- a/gui/greeter/greeter_item_capslock.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_ITEM_CAPSLOCK_H__
-#define __GREETER_ITEM_CAPSLOCK_H__
-
-#include "greeter_item.h"
-
-gboolean greeter_item_capslock_setup (GtkWidget *window);
-gboolean greeter_is_capslock_on (void);
-
-#endif
diff --git a/gui/greeter/greeter_item_clock.c b/gui/greeter/greeter_item_clock.c
deleted file mode 100644
index 0779f9ab..00000000
--- a/gui/greeter/greeter_item_clock.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <time.h>
-#include "greeter_item_clock.h"
-#include "greeter_parser.h"
-
-static gboolean
-update_clock (gpointer data)
-{
- GreeterItemInfo *info = data;
- struct tm *the_tm;
- time_t the_time;
- gint time_til_next_min;
-
- greeter_item_update_text (info);
-
- time (&the_time);
- the_tm = localtime (&the_time);
- /* account for leap seconds */
- time_til_next_min = 60 - the_tm->tm_sec;
- time_til_next_min = (time_til_next_min>=0?time_til_next_min:0);
-
- g_timeout_add (time_til_next_min*1000, update_clock, info);
-
- return FALSE;
-}
-
-
-gboolean
-greeter_item_clock_setup (void)
-{
- GreeterItemInfo *info;
-
- info = greeter_lookup_id ("clock");
- if (info)
- update_clock (info);
-
- return TRUE;
-}
-
-void
-greeter_item_clock_update (void)
-{
- GreeterItemInfo *info;
-
- info = greeter_lookup_id ("clock");
- if (info)
- greeter_item_update_text (info);
-}
diff --git a/gui/greeter/greeter_item_clock.h b/gui/greeter/greeter_item_clock.h
deleted file mode 100644
index d2af2bf9..00000000
--- a/gui/greeter/greeter_item_clock.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_ITEM_CLOCK_H__
-#define __GREETER_ITEM_CLOCK_H__
-
-#include "greeter_item.h"
-
-gboolean greeter_item_clock_setup (void);
-void greeter_item_clock_update (void);
-
-#endif
diff --git a/gui/greeter/greeter_item_customlist.c b/gui/greeter/greeter_item_customlist.c
deleted file mode 100644
index 857d30db..00000000
--- a/gui/greeter/greeter_item_customlist.c
+++ /dev/null
@@ -1,659 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-
-#include "gdm.h"
-#include "gdmconfig.h"
-#include "gdmsession.h"
-
-#include "greeter_item.h"
-#include "greeter_configuration.h"
-#include "greeter_item_customlist.h"
-#include "greeter_parser.h"
-#include "greeter_session.h"
-#include "greeter_action_language.h"
-
-/*
- * Keep track of the session/language widgets so we can
- * set their values when the session/language dialogs are
- * changed.
- */
-static GtkWidget *session_widget = NULL;
-static GtkWidget *language_widget = NULL;
-static gchar *session_key = NULL;
-
-extern GList *sessions;
-extern GHashTable *sessnames;
-
-enum
-{
- GREETER_LIST_TEXT = 0,
- GREETER_LIST_ID
-};
-
-/*
- * This function sets the custom list when the session list has changed in
- * the session dialog (launched from session button or F10 menu).
- */
-void
-greeter_custom_set_session (gchar *session)
-{
- GList *tmp;
- int i=0;
-
- /*
- * Since the sessions are created before the session list is generated,
- * keep track of the session and set active row when it is setup. This
- * function will get a NULL when the session is initialized to NULL
- * at startup, so just return.
- */
- if (session == NULL)
- return;
- else
- {
- /*
- * If the session_widget hasn't been setup yet (which it won't be when
- * the greeter_sessioninit function is called, then just store the
- * session and we'll set the value when the combo box is initialized later.
- */
- g_free (session_key);
- session_key = g_strdup (session);
- }
-
- /* Do nothing if there is no session widget */
- if (session_widget == NULL)
- return;
-
- /* Last isn't in the session list, so handle separate. */
- if (strcmp (session, LAST_SESSION) == 0)
- {
- if (GTK_IS_COMBO_BOX (session_widget))
- {
- gtk_combo_box_set_active (GTK_COMBO_BOX (session_widget), 0);
- }
- else if (GTK_IS_SCROLLED_WINDOW (session_widget) &&
- GTK_IS_TREE_VIEW (GTK_BIN (session_widget)->child))
- {
- GtkTreeView *tv = GTK_TREE_VIEW (GTK_BIN (session_widget)->child);
- GtkTreeModel *tm = gtk_tree_view_get_model (tv);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (tv);
- GtkTreeIter loopiter;
-
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (tm), &loopiter))
- gtk_tree_selection_select_iter (selection, &loopiter);
- }
- }
-
- /*
- * Handle for either combo box or list style, depending on which is being
- * used.
- . */
- if (GTK_IS_COMBO_BOX (session_widget))
- {
- for (tmp = sessions; tmp != NULL; tmp = tmp->next)
- {
- char *file;
-
- i++;
- file = tmp->data;
- if (strcmp (session, file) == 0)
- {
- gtk_combo_box_set_active (GTK_COMBO_BOX (session_widget), i);
- break;
- }
- }
- }
- else if (GTK_IS_SCROLLED_WINDOW (session_widget) &&
- GTK_IS_TREE_VIEW (GTK_BIN (session_widget)->child))
- {
- GtkTreeView *tv = GTK_TREE_VIEW (GTK_BIN (session_widget)->child);
- GtkTreeModel *tm = gtk_tree_view_get_model (tv);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (tv);
- GtkTreeIter loopiter;
-
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (tm), &loopiter))
- {
- do
- {
- char *file;
-
- gtk_tree_model_get (GTK_TREE_MODEL (tm), &loopiter, GREETER_LIST_ID, &file, -1);
- if (file != NULL && strcmp (session, file) == 0)
- {
- GtkTreePath *path = gtk_tree_model_get_path (tm, &loopiter);
-
- gtk_tree_selection_select_iter (selection, &loopiter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tv),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- break;
- }
- } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (tm), &loopiter));
- }
- }
-}
-
-/*
- * This function sets the custom list when the language list has changed in
- * the language dialog (launched from language button or F10 menu).
- */
-void
-greeter_custom_set_language (gchar *language)
-{
- GtkListStore *lang_model = greeter_language_get_model ();
- GtkTreeIter iter;
- gboolean valid;
- char *locale_name;
- int i=0;
-
- /* Do nothing if there is no language widget */
- if (language_widget == NULL)
- return;
-
- /*
- * Handle for either combo box or list style, depending on which is being
- * used.
- . */
- if (GTK_IS_COMBO_BOX (language_widget))
- {
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (lang_model),
- &iter);
- while (valid)
- {
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter,
- LOCALE_COLUMN, &locale_name, -1);
-
- if (strcmp (language, locale_name) == 0)
- {
- gtk_combo_box_set_active (GTK_COMBO_BOX (language_widget), i);
- break;
- }
- valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (lang_model), &iter);
- i++;
- }
- }
- else if (GTK_IS_SCROLLED_WINDOW (language_widget) &&
- GTK_IS_TREE_VIEW (GTK_BIN (language_widget)->child))
- {
- GtkTreeView *tv = GTK_TREE_VIEW (GTK_BIN (language_widget)->child);
- GtkTreeModel *tm = gtk_tree_view_get_model (tv);
- GtkTreeSelection *selection = gtk_tree_view_get_selection (tv);
- GtkTreeIter loopiter;
-
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (tm), &loopiter))
- {
- do
- {
- char *locale_file;
-
- gtk_tree_model_get (GTK_TREE_MODEL (tm), &loopiter, GREETER_LIST_ID, &locale_file, -1);
- if (locale_file != NULL && strcmp (language, locale_file) == 0)
- {
- GtkTreePath *path = gtk_tree_model_get_path (tm, &loopiter);
-
- gtk_tree_selection_select_iter (selection, &loopiter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (tv),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- break;
- }
- } while (gtk_tree_model_iter_next (GTK_TREE_MODEL (tm), &loopiter));
- }
- }
-}
-
-/* Helper function to set custom list values */
-static void
-populate_list (GtkTreeModel *tm, GtkTreeSelection *selection, GList *list_items)
-{
- GList *li;
-
- for (li = list_items; li != NULL; li = li->next)
- {
- GtkTreeIter iter = {0};
- GreeterItemListItem *litem = li->data;
- gtk_list_store_append (GTK_LIST_STORE (tm), &iter);
- gtk_list_store_set (GTK_LIST_STORE (tm), &iter,
- GREETER_LIST_TEXT, litem->text,
- GREETER_LIST_ID, litem->id,
- -1);
- }
-}
-
-/* Helper function to set session values */
-static void
-populate_session (GObject * object)
-{
- GList *tmp;
-
- /* Last isn't in the session list, so add separate. */
- if (GTK_IS_COMBO_BOX (object))
- gtk_combo_box_append_text (GTK_COMBO_BOX (object), _("Last session"));
- else if (GTK_IS_TREE_MODEL (object))
- {
- GtkTreeIter loopiter;
- GtkTreeModel *tm = GTK_TREE_MODEL (object);
-
- gtk_list_store_append (GTK_LIST_STORE (tm), &loopiter);
-
- gtk_list_store_set (GTK_LIST_STORE (tm), &loopiter,
- GREETER_LIST_TEXT, _("Last session"),
- GREETER_LIST_ID, LAST_SESSION,
- -1);
- }
-
- /* Loop through the sessions and set the custom list values. */
- for (tmp = sessions; tmp != NULL; tmp = tmp->next)
- {
- GdmSession *session;
- char *file;
-
- file = (char *) tmp->data;
- session = g_hash_table_lookup (sessnames, file);
-
- if (GTK_IS_COMBO_BOX (object))
- {
- if (session->clearname != NULL)
- gtk_combo_box_append_text (GTK_COMBO_BOX (object), (session->clearname));
- else
- gtk_combo_box_append_text (GTK_COMBO_BOX (object), (session->name));
- }
- else if (GTK_IS_TREE_MODEL (object))
- {
- GtkTreeIter loopiter;
- GtkTreeModel *tm = GTK_TREE_MODEL (object);
- gchar *to_display;
-
- gtk_list_store_append (GTK_LIST_STORE (tm), &loopiter);
- if (session->clearname != NULL)
- to_display = session->clearname;
- else
- to_display = session->name;
-
- gtk_list_store_set (GTK_LIST_STORE (tm), &loopiter,
- GREETER_LIST_TEXT, to_display,
- GREETER_LIST_ID, file,
- -1);
- }
- }
-
- /*
- * Set the session if one exists, this will calback and set the
- * custom list
- */
- if (session_key != NULL)
- greeter_custom_set_session (session_key);
-}
-
-/* Helper function to set language values */
-static void
-populate_language (GObject *object)
-{
- GtkListStore *lang_model = greeter_language_get_model ();
- GtkTreeIter iter;
- char *name, *untranslated, *display_name, *locale_name;
- gboolean valid;
-
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (lang_model),
- &iter);
- while (valid)
- {
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter,
- TRANSLATED_NAME_COLUMN, &name,
- UNTRANSLATED_NAME_COLUMN, &untranslated,
- LOCALE_COLUMN, &locale_name, -1);
-
- if (untranslated)
- display_name = g_strdup_printf ("%s (%s)", name, untranslated);
- else
- display_name = g_strdup (name);
-
- if (GTK_IS_COMBO_BOX (object))
- gtk_combo_box_append_text (GTK_COMBO_BOX (object), display_name);
- else if (GTK_IS_TREE_MODEL (object))
- {
- GtkTreeIter loopiter;
- GtkTreeModel *tm = GTK_TREE_MODEL (object);
-
- gtk_list_store_append (GTK_LIST_STORE (tm), &loopiter);
- gtk_list_store_set (GTK_LIST_STORE (tm), &loopiter,
- GREETER_LIST_TEXT, display_name,
- GREETER_LIST_ID, locale_name,
- -1);
- }
- valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (lang_model), &iter);
- }
-}
-
-/* Callback helper function to set session value */
-static void
-combo_session_selected (char *session_val)
-{
- GList *tmp;
- char *file;
-
- /* Last isn't in the session list, so add separate. */
- if (strcmp (session_val, _("Last session")) == 0)
- greeter_set_session (LAST_SESSION);
- else
- {
- /*
- * Loop through the sessions to find the row the
- * user has selected, and set that session.
- */
- for (tmp = sessions; tmp != NULL; tmp = tmp->next)
- {
- GdmSession *session;
- char *name;
-
- file = tmp->data;
- session = g_hash_table_lookup (sessnames, file);
-
- if (session->clearname)
- name = session->clearname;
- else
- name = session->name;
-
- if (strcmp (name, session_val) == 0)
- {
- greeter_set_session (file);
- break;
- }
- }
- }
-}
-
-/* Callback function for combo style custom lists */
-static void
-combo_selected (GtkComboBox *combo, GreeterItemInfo *item)
-{
- char *id = NULL;
- char *file;
- char *active;
-
- if (ve_string_empty (item->id))
- return;
-
- active = gtk_combo_box_get_active_text (combo);
-
- if (strcmp (item->id, "session") == 0)
- {
- combo_session_selected (active);
- }
- else if (strcmp (item->id, "language") == 0)
- {
- /*
- * Since combo boxes can't store the ID value, have to do some
- * extra work to figure out which row is selected.
- */
- GtkListStore *lang_model = greeter_language_get_model ();
- GtkTreeIter iter;
- char *name, *untranslated, *display_name, *locale_name;
- gboolean valid;
-
- valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (lang_model),
- &iter);
- while (valid)
- {
- gtk_tree_model_get (GTK_TREE_MODEL (lang_model), &iter,
- TRANSLATED_NAME_COLUMN, &name,
- UNTRANSLATED_NAME_COLUMN, &untranslated,
- LOCALE_COLUMN, &locale_name, -1);
-
- if (untranslated)
- display_name = g_strdup_printf ("%s (%s)", name, untranslated);
- else
- display_name = g_strdup (name);
-
- if (strcmp (display_name, active) == 0)
- {
- greeter_language_set (locale_name);
- break;
- }
- g_free (display_name);
- valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (lang_model), &iter);
- }
- }
- else
- {
- if (DOING_GDM_DEVELOPMENT)
- return;
-
- id = gtk_combo_box_get_active_text (combo);
- file = g_strdup_printf ("%s/%s.GreeterInfo",
- ve_sure_string (gdm_config_get_string (GDM_KEY_SERV_AUTHDIR)),
- ve_sure_string (g_getenv ("DISPLAY")));
-
- gdm_save_customlist_data (file, item->id, id);
- }
-}
-
-/* Setup combo sytle custom list */
-static void
-setup_combo_customlist (GtkComboBox *combo, GreeterItemInfo *item)
-{
- GList *li;
-
- g_signal_connect (G_OBJECT (combo), "changed",
- G_CALLBACK (combo_selected), item);
-
- /* Make sure that focus never leaves username/password entry */
- gtk_combo_box_set_focus_on_click (combo, FALSE);
-
- if (strcmp (item->id, "session") == 0)
- {
- populate_session (G_OBJECT (combo));
- /*
- * Do not select since the session_init will initialize the
- * value and cause the combo list to get set without needing
- * to do it here.
- */
- }
- else if (strcmp (item->id, "language") == 0)
- {
- populate_language (G_OBJECT (combo));
- /* Select first */
- gtk_combo_box_set_active (combo, 0);
- }
- else
- {
- for (li = item->data.list.items; li != NULL; li = li->next)
- {
- GreeterItemListItem *litem = li->data;
- gtk_combo_box_append_text (combo, litem->text);
- }
- /* Select first */
- gtk_combo_box_set_active (combo, 0);
- }
-}
-
-/* Callback function for list style custom lists */
-static void
-list_selected (GtkTreeSelection *selection, GreeterItemInfo *item)
-{
- GtkTreeModel *tm = NULL;
- GtkTreeIter iter = {0};
- char *id = NULL;
- char *file;
-
- if (ve_string_empty (item->id))
- return;
-
- if (gtk_tree_selection_get_selected (selection, &tm, &iter))
- {
- gtk_tree_model_get (tm, &iter, GREETER_LIST_ID,
- &id, -1);
- }
-
- /*
- * Note for session and language we are using the id to store the
- * value to pass in.
- */
- if (strcmp (item->id, "session") == 0)
- {
- if (id != NULL)
- greeter_set_session (id);
- }
- else if (strcmp (item->id, "language") == 0)
- {
- if (id != NULL)
- greeter_language_set (id);
- }
- else
- {
- if (DOING_GDM_DEVELOPMENT)
- return;
-
- file = g_strdup_printf ("%s/%s.GreeterInfo",
- ve_sure_string (gdm_config_get_string (GDM_KEY_SERV_AUTHDIR)),
- ve_sure_string (g_getenv ("DISPLAY")));
-
- gdm_save_customlist_data (file, item->id, id);
- }
-}
-
-static gboolean custom_list_release_event (GtkWidget *widget,
- GdkEventSelection *event,
- gpointer user_data)
-{
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
-
- /* Make sure that focus never leaves username/password entry */
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
- gtk_widget_grab_focus (entry);
- }
- return FALSE;
-}
-
-/* Setup custom list style */
-static void
-setup_customlist (GtkWidget *tv, GreeterItemInfo *item)
-{
- GtkTreeModel *tm;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
- GtkTreeIter iter = {0};
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv),
- FALSE);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
-
- g_signal_connect (selection, "changed",
- G_CALLBACK (list_selected),
- item);
-
- tm = (GtkTreeModel *)gtk_list_store_new (2,
- G_TYPE_STRING,
- G_TYPE_STRING);
- gtk_tree_view_set_model (GTK_TREE_VIEW (tv), tm);
-
- column = gtk_tree_view_column_new_with_attributes
- ("Choice",
- gtk_cell_renderer_text_new (),
- "text", GREETER_LIST_TEXT,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column);
-
- g_signal_connect (tv, "button_release_event",
- G_CALLBACK (custom_list_release_event),
- NULL);
-
- if (strcmp (item->id, "session") == 0)
- {
- populate_session (G_OBJECT (tm));
- /*
- * Do not select since the session_init will initialize the
- * value and cause the combo list to get set without needing
- * to do it here.
- */
- }
- else if (strcmp (item->id, "language") == 0)
- {
- populate_language (G_OBJECT (tm));
-
- /* Select first item */
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (tm), &iter))
- gtk_tree_selection_select_iter (selection, &iter);
- }
- else
- {
- populate_list (tm, selection, item->data.list.items);
-
- /* Select first item */
- if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (tm), &iter))
- gtk_tree_selection_select_iter (selection, &iter);
- }
-}
-
-/*
- * This function initializes all custom lists aside from
- * the userlist (face browser), which is handled
- * separately.
- */
-gboolean
-greeter_item_customlist_setup (void)
-{
- const GList *custom_items = greeter_custom_items ();
- const GList *li;
- for (li = custom_items; li != NULL; li = li->next)
- {
- GreeterItemInfo *info = li->data;
-
- if (info != NULL &&
- info->item_type == GREETER_ITEM_TYPE_LIST &&
- info->item != NULL &&
- GNOME_IS_CANVAS_WIDGET (info->item))
- {
- GtkWidget *sw = GNOME_CANVAS_WIDGET (info->item)->widget;
-
- /*
- * Store these so that when the values change in the
- * F10 session/language dialogs, we can easily modify
- * them.
- */
- if (strcmp (info->id, "session") == 0)
- session_widget = sw;
- else if (strcmp (info->id, "language") == 0)
- language_widget = sw;
-
- /* If combo or list style, process appropriately */
- if (GTK_IS_SCROLLED_WINDOW (sw) &&
- GTK_IS_TREE_VIEW (GTK_BIN (sw)->child))
- {
- setup_customlist (GTK_BIN (sw)->child, info);
- }
- else if (GTK_IS_COMBO_BOX (sw))
- {
- setup_combo_customlist (GTK_COMBO_BOX (sw), info);
- }
- }
- }
- return TRUE;
-}
-
diff --git a/gui/greeter/greeter_item_customlist.h b/gui/greeter/greeter_item_customlist.h
deleted file mode 100644
index b3ecb951..00000000
--- a/gui/greeter/greeter_item_customlist.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_ITEM_CUSTOMLIST_H__
-#define __GREETER_ITEM_CUSTOMLIST_H__
-
-#include "greeter_item.h"
-
-gboolean greeter_item_customlist_setup (void);
-void greeter_custom_set_session (gchar *session);
-void greeter_custom_set_language (gchar *language);
-
-#endif
diff --git a/gui/greeter/greeter_item_pam.c b/gui/greeter/greeter_item_pam.c
deleted file mode 100644
index b2cdc266..00000000
--- a/gui/greeter/greeter_item_pam.c
+++ /dev/null
@@ -1,431 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <string.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <gdk/gdkkeysyms.h>
-
-#include "viciousui.h"
-
-#include "greeter.h"
-#include "greeter_item.h"
-#include "greeter_item_pam.h"
-#include "greeter_item_ulist.h"
-#include "greeter_item_timed.h"
-#include "greeter_parser.h"
-#include "greeter_configuration.h"
-#include "greeter_canvas_item.h"
-#include "gdm.h"
-#include "gdmwm.h"
-#include "gdmcommon.h"
-
-static gboolean messages_to_give = FALSE;
-static gboolean replace_msg = TRUE;
-static guint err_box_clear_handler = 0;
-
-gchar *greeter_current_user = NULL;
-
-gboolean require_quarter = FALSE;
-
-extern gboolean greeter_probably_login_prompt;
-extern GtkButton *gtk_ok_button;
-extern GtkButton *gtk_start_again_button;
-
-static gboolean
-greeter_item_pam_error_set (gboolean display)
-{
- GreeterItemInfo *info;
- GnomeCanvasItem *item;
-
- info = greeter_lookup_id ("pam-error-logo");
-
- if (info)
- {
- if (info->group_item != NULL)
- item = GNOME_CANVAS_ITEM (info->group_item);
- else
- item = info->item;
-
- if (display)
- gnome_canvas_item_show (item);
- else
- gnome_canvas_item_hide (item);
- }
-
- return TRUE;
-}
-
-void
-greeter_item_pam_set_user (const char *user)
-{
- g_free (greeter_current_user);
- greeter_current_user = g_strdup (user);
- greeter_item_ulist_set_user (user);
-}
-
-static gboolean
-evil (GtkEntry *entry, const char *user)
-{
- /* do not translate */
- if (strcmp (user, "Gimme Random Cursor") == 0) {
- gdm_common_setup_cursor (((rand () >> 3) % (GDK_LAST_CURSOR/2)) * 2);
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- /* do not translate */
- } else if (strcmp (user, "Require Quater") == 0 ||
- strcmp (user, "Require Quarter") == 0) {
- /* btw, note that I misspelled quarter before and
- * thus this checks for Quater as well as Quarter to
- * keep compatibility which is obviously important for
- * something like this */
- require_quarter = TRUE;
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return TRUE;
- }
-
- return FALSE;
-}
-
-static void
-set_text (GreeterItemInfo *info, const char *text)
-{
- greeter_canvas_item_break_set_string (info,
- text,
- FALSE /* markup */,
- info->data.text.real_max_width,
- NULL /* width */,
- NULL /* height */,
- NULL /* canvas */,
- info->item);
-}
-
-void
-greeter_item_pam_login (GtkEntry *entry, GreeterItemInfo *info)
-{
- const char *str;
- char *tmp;
- GreeterItemInfo *error_info;
-
- if (gtk_ok_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), FALSE);
- if (gtk_start_again_button != NULL)
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_start_again_button), FALSE);
-
- greeter_ignore_buttons (TRUE);
-
- str = gtk_entry_get_text (GTK_ENTRY (entry));
- if (greeter_probably_login_prompt &&
- /* evilness */
- evil (entry, str))
- {
- /* obviously being 100% reliable is not an issue for
- this test */
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- return;
- }
-
- if (greeter_probably_login_prompt &&
- ve_string_empty (str) &&
- greeter_item_timed_is_timed ())
- {
- /* timed interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_TIMED_LOGIN);
- fflush (stdout);
- return;
- }
-
- gtk_widget_set_sensitive (GTK_WIDGET (entry), FALSE);
-
- /* clear the err_box */
- if (err_box_clear_handler > 0)
- {
- g_source_remove (err_box_clear_handler);
- err_box_clear_handler = 0;
- }
- error_info = greeter_lookup_id ("pam-error");
- if (error_info) {
- greeter_item_pam_error_set (FALSE);
- set_text (error_info, "");
- }
-
- tmp = ve_locale_from_utf8 (str);
- printf ("%c%s\n", STX, tmp);
- fflush (stdout);
- g_free (tmp);
-}
-
-static gboolean
-pam_key_release_event (GtkWidget *entry, GdkEventKey *event, gpointer data)
-{
- GreeterItemInfo *entry_info = greeter_lookup_id ("user-pw-entry");
-
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- const char *login_string;
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
-
- if ((event->keyval == GDK_Tab ||
- event->keyval == GDK_KP_Tab) &&
- (event->state & (GDK_CONTROL_MASK|GDK_MOD1_MASK|GDK_SHIFT_MASK)) == 0)
- {
- greeter_item_pam_login (GTK_ENTRY (entry), entry_info);
- return TRUE;
- }
-
- if (gtk_ok_button != NULL)
- {
- /*
- * Set ok button to sensitive only if there are characters in
- * the entry field
- */
- login_string = gtk_entry_get_text (GTK_ENTRY (entry));
- if (login_string != NULL && login_string[0] != '\0')
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), TRUE);
- else
- gtk_widget_set_sensitive (GTK_WIDGET (gtk_ok_button), FALSE);
- }
- }
- return FALSE;
-}
-
-gboolean
-greeter_item_pam_setup (void)
-{
- GreeterItemInfo *entry_info;
-
- greeter_item_pam_error_set (FALSE);
-
- entry_info = greeter_lookup_id ("user-pw-entry");
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
- {
- GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
- gtk_widget_grab_focus (entry);
-
- if ( ! DOING_GDM_DEVELOPMENT)
- {
- /* hack. For some reason if we leave it blank,
- * we'll get a little bit of activity on first keystroke,
- * this way we get rid of it, it will be cleared for the
- * first prompt anyway. */
- gtk_entry_set_text (GTK_ENTRY (entry), "...");
-
- /* initially insensitive */
- gtk_widget_set_sensitive (entry, FALSE);
- }
-
- g_signal_connect (entry, "activate",
- G_CALLBACK (greeter_item_pam_login), entry_info);
- g_signal_connect (G_OBJECT (entry), "key_release_event",
- G_CALLBACK (pam_key_release_event), NULL);
- }
-
- return TRUE;
-}
-
-
-void
-greeter_item_pam_prompt (const char *message,
- int entry_len,
- gboolean entry_visible)
-{
- GreeterItemInfo *conversation_info;
- GreeterItemInfo *entry_info;
- GtkWidget *entry;
-
- conversation_info = greeter_lookup_id ("pam-prompt");
- entry_info = greeter_lookup_id ("user-pw-entry");
-
- if (conversation_info)
- {
- set_text (conversation_info, message);
-
- /*
- * Add Accessibility text for entry field.
- * Might be nice to set ATK_RELATION_LABEL_FOR, LABELLED_BY between
- * the label (pam-prompt) and the entry, but gdmgreeter doesn't use real
- * GTK widgets for text fields. For now, just set the entry field's
- * name.
- */
- if (entry_info != NULL)
- {
- GnomeCanvasWidget *item = GNOME_CANVAS_WIDGET (entry_info->item);
- if (item != NULL)
- {
- GtkWidget *widget = item->widget;
- if (widget != NULL)
- {
- AtkObject *atk_widget;
- atk_widget = gtk_widget_get_accessible (widget);
- if (atk_widget != NULL)
- {
- atk_object_set_name (atk_widget, message);
- }
- }
- }
- }
- }
-
- if (entry_info && entry_info->item &&
- GNOME_IS_CANVAS_WIDGET (entry_info->item))
- {
- entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
-
- gtk_entry_set_visibility (GTK_ENTRY (entry), entry_visible);
- gtk_widget_set_sensitive (GTK_WIDGET (entry), TRUE);
- gtk_entry_set_max_length (GTK_ENTRY (entry), entry_len);
- gtk_entry_set_text (GTK_ENTRY (entry), "");
- gtk_widget_grab_focus (entry);
- }
-
- messages_to_give = FALSE;
- replace_msg = TRUE;
-}
-
-void
-greeter_item_pam_message (const char *message)
-{
- GreeterItemInfo *message_info;
- char *oldtext;
- char *newtext;
-
- /* the user has not yet seen messages */
- messages_to_give = TRUE;
-
- message_info = greeter_lookup_id ("pam-message");
-
- if (message_info)
- {
- /* HAAAAAAACK. Sometimes pam sends many many messages, SO
- * we try to collect them until the next prompt or reset or
- * whatnot */
- if ( ! replace_msg &&
- /* empty message is for clearing */
- ! ve_string_empty (message))
- {
- g_object_get (G_OBJECT (message_info->item),
- "text", &oldtext,
- NULL);
- if (strlen (oldtext) > 0)
- {
- newtext = g_strdup_printf ("%s\n%s", oldtext, message);
- set_text (message_info, newtext);
- g_free (newtext);
- }
- else
- set_text (message_info, message);
- }
- else
- set_text (message_info, message);
- }
- replace_msg = FALSE;
-}
-
-
-static gboolean
-error_clear (gpointer data)
-{
- GreeterItemInfo *error_info = data;
- err_box_clear_handler = 0;
-
- set_text (error_info, "");
- greeter_item_pam_error_set (FALSE);
-
- return FALSE;
-}
-
-void
-greeter_item_pam_error (const char *message)
-{
- GreeterItemInfo *error_info;
-
- /* The message I got from pam had a silly newline
- * in the beginning. That may make sense for a
- * terminal based conversation, but it sucks for
- * us, so skip it.
- */
- if (message[0] == '\n')
- message++;
-
- error_info = greeter_lookup_id ("pam-error");
- if (error_info)
- {
- set_text (error_info, message);
-
- if (err_box_clear_handler > 0)
- g_source_remove (err_box_clear_handler);
-
- if (strlen (message) == 0)
- err_box_clear_handler = 0;
- else
- err_box_clear_handler = g_timeout_add (30000,
- error_clear,
- error_info);
- greeter_item_pam_error_set (TRUE);
- }
-}
-
-void
-greeter_item_pam_leftover_messages (void)
-{
- if (messages_to_give)
- {
- char *oldtext = NULL;
- GreeterItemInfo *message_info;
-
- message_info = greeter_lookup_id ("pam-message");
-
- if (message_info != NULL)
- {
- g_object_get (G_OBJECT (message_info->item),
- "text", &oldtext,
- NULL);
- }
-
- if ( ! ve_string_empty (oldtext))
- {
- GtkWidget *dlg;
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- dlg = ve_hig_dialog_new (NULL /* parent */,
- GTK_DIALOG_MODAL /* flags */,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- oldtext,
- "");
- gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
- gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
- gdm_wm_center_window (GTK_WINDOW (dlg));
-
- gdm_wm_no_login_focus_push ();
- gtk_dialog_run (GTK_DIALOG (dlg));
- gtk_widget_destroy (dlg);
- gdm_wm_no_login_focus_pop ();
- }
- messages_to_give = FALSE;
- }
-}
-
diff --git a/gui/greeter/greeter_item_pam.h b/gui/greeter/greeter_item_pam.h
deleted file mode 100644
index 0d1d3a6e..00000000
--- a/gui/greeter/greeter_item_pam.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_ITEM_PAM_H
-#define GREETER_ITEM_PAM_H
-
-#include "greeter_item.h"
-
-gboolean greeter_item_pam_setup (void);
-void greeter_item_pam_prompt (const char *message,
- int entry_len,
- gboolean entry_visible);
-void greeter_item_pam_message (const char *message);
-void greeter_item_pam_error (const char *message);
-void greeter_item_pam_set_user (const char *user);
-void greeter_item_pam_leftover_messages (void);
-void greeter_item_pam_login (GtkEntry *entry, GreeterItemInfo *info);
-
-extern gchar *greeter_current_user;
-
-#endif
diff --git a/gui/greeter/greeter_item_timed.c b/gui/greeter/greeter_item_timed.c
deleted file mode 100644
index c24b24f6..00000000
--- a/gui/greeter/greeter_item_timed.c
+++ /dev/null
@@ -1,152 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "gdm.h"
-#include "gdmconfig.h"
-
-#include "greeter_parser.h"
-#include "greeter_configuration.h"
-#include "greeter_item_timed.h"
-
-extern gint gdm_timed_delay;
-
-static guint timed_handler_id = 0;
-
-static void
-greeter_item_timed_update (void)
-{
- GreeterItemInfo *info;
-
- info = greeter_lookup_id ("timed-label");
- if (info != NULL)
- {
- greeter_item_update_text (info);
- }
-}
-
-/*
- * Timed Login: Timer
- */
-
-static gboolean
-gdm_timer (gpointer data)
-{
- greeter_item_timed_update ();
- gdm_timed_delay--;
- if (gdm_timed_delay <= 0)
- {
- /* timed interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_TIMED_LOGIN);
- fflush (stdout);
- }
- return TRUE;
-}
-
-/*
- * Timed Login: On GTK events, increase delay to at least 30
- * seconds. Or the GDM_KEY_TIMED_LOGIN_DELAY, whichever is higher
- */
-
-static gboolean
-gdm_timer_up_delay (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- int timeddelay = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
-
- if (gdm_timed_delay < 30)
- gdm_timed_delay = 30;
- if (gdm_timed_delay < timeddelay)
- gdm_timed_delay = timeddelay;
- return TRUE;
-}
-
-gboolean
-greeter_item_timed_setup (void)
-{
-
- /* if in timed mode, delay timeout on keyboard or menu activity */
- if ( ! ve_string_empty (gdm_config_get_string (GDM_KEY_TIMED_LOGIN)))
- {
- guint sid;
-
- g_type_class_ref (GTK_TYPE_MENU_ITEM);
-
- sid = g_signal_lookup ("activate",
- GTK_TYPE_MENU_ITEM);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
-
- sid = g_signal_lookup ("key_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
- sid = g_signal_lookup ("button_press_event",
- GTK_TYPE_WIDGET);
- g_signal_add_emission_hook (sid,
- 0 /* detail */,
- gdm_timer_up_delay,
- NULL /* data */,
- NULL /* destroy_notify */);
- }
-
- return TRUE;
-}
-
-void
-greeter_item_timed_start (void)
-{
- int timeddelay = gdm_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
-
- if (timed_handler_id == 0 &&
- gdm_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE) &&
- ! ve_string_empty (gdm_config_get_string (GDM_KEY_TIMED_LOGIN)) &&
- timeddelay > 0)
- {
- gdm_timed_delay = timeddelay;
- timed_handler_id = g_timeout_add (1000, gdm_timer, NULL);
- }
-}
-
-void
-greeter_item_timed_stop (void)
-{
- if (timed_handler_id != 0)
- {
- g_source_remove (timed_handler_id);
- timed_handler_id = 0;
- }
-}
-
-gboolean
-greeter_item_timed_is_timed (void)
-{
- return timed_handler_id != 0;
-}
diff --git a/gui/greeter/greeter_item_timed.h b/gui/greeter/greeter_item_timed.h
deleted file mode 100644
index bd544adc..00000000
--- a/gui/greeter/greeter_item_timed.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_ITEM_TIMED_H
-#define GREETER_ITEM_TIMED_H
-
-#include "greeter_item.h"
-
-gboolean greeter_item_timed_setup (void);
-void greeter_item_timed_start (void);
-void greeter_item_timed_stop (void);
-gboolean greeter_item_timed_is_timed (void);
-
-#endif
diff --git a/gui/greeter/greeter_item_ulist.c b/gui/greeter/greeter_item_ulist.c
deleted file mode 100644
index 3a8636e2..00000000
--- a/gui/greeter/greeter_item_ulist.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
- *
- * GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <math.h>
-#include <string.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <librsvg/rsvg.h>
-
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmcomm.h"
-#include "gdmconfig.h"
-#include "gdmuser.h"
-
-#include "greeter.h"
-#include "greeter_item_ulist.h"
-#include "greeter_parser.h"
-#include "greeter_configuration.h"
-#include "greeter_item.h"
-
-static GList *users = NULL;
-static GList *users_string = NULL;
-static GdkPixbuf *defface;
-static GHashTable *displays_hash = NULL;
-
-static GtkWidget *pam_entry = NULL;
-static GtkWidget *user_list = NULL;
-static gboolean selecting_user = FALSE;
-static gchar *selected_user = NULL;
-static int num_users = 0;
-
-enum
-{
- GREETER_ULIST_ICON_COLUMN = 0,
- GREETER_ULIST_LABEL_COLUMN,
- GREETER_ULIST_LOGIN_COLUMN,
- GREETER_ULIST_ACTIVE_COLUMN
-};
-
-/* Hide the userlist if there are no users displayed */
-void
-greeter_item_ulist_check_show_userlist (void)
-{
- /*
- * If there are no users, then hide the rectangle used to contain the
- * userlist. The userlist-rect id allows a rectangle to be defined
- * with alpha behind the userlist that also goes away when the list is
- * empty.
- */
- if (num_users == 0) {
- GreeterItemInfo *urinfo = greeter_lookup_id ("userlist-rect");
-
- if (user_list != NULL)
- gtk_widget_hide (user_list);
-
- if (urinfo) {
- GnomeCanvasItem *item;
-
- if (urinfo->group_item != NULL)
- item = GNOME_CANVAS_ITEM (urinfo->group_item);
- else
- item = urinfo->item;
-
- gnome_canvas_item_hide (item);
- }
- }
-}
-
-void
-greeter_item_ulist_unset_selected_user (void)
-{
- GtkTreeSelection *selection;
- if (user_list != NULL) {
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (user_list));
- gtk_tree_selection_unselect_all (GTK_TREE_SELECTION (selection));
- }
-
- if (selected_user != NULL)
- g_free (selected_user);
- selected_user = NULL;
-}
-
-static void
-check_for_displays (void)
-{
- char *ret;
- char **vec;
- char *auth_cookie = NULL;
- int i;
-
- /*
- * Might be nice to move this call into read_config() so that it happens
- * on the same socket call as reading the configuration.
- */
- ret = gdmcomm_call_gdm (GDM_SUP_ATTACHED_SERVERS, auth_cookie, "2.2.4.0", 5);
- if (ve_string_empty (ret) || strncmp (ret, "OK ", 3) != 0) {
- g_free (ret);
- return;
- }
-
- vec = g_strsplit (&ret[3], ";", -1);
- g_free (ret);
- if (vec == NULL)
- return;
-
- if (displays_hash == NULL)
- displays_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_free);
-
- for (i = 0; vec[i] != NULL; i++) {
- char **rvec;
-
- rvec = g_strsplit (vec[i], ",", -1);
- if (rvec == NULL || ve_vector_len (rvec) != 3)
- continue;
-
- g_hash_table_insert (displays_hash,
- g_strdup (rvec[1]),
- g_strdup (rvec[0]));
-
- g_strfreev (rvec);
- }
-
- g_strfreev (vec);
-}
-
-static void
-gdm_greeter_users_init (void)
-{
- gint size_of_users = 0;
-
- defface = gdm_common_get_face (NULL,
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE),
- gdm_config_get_int (GDM_KEY_MAX_ICON_WIDTH),
- gdm_config_get_int (GDM_KEY_MAX_ICON_HEIGHT));
- if (! defface) {
- gdm_common_warning ("Can't open DefaultImage: %s!",
- gdm_config_get_string (GDM_KEY_DEFAULT_FACE));
- }
-
- gdm_users_init (&users, &users_string, NULL, defface,
- &size_of_users, GDM_IS_LOCAL, !DOING_GDM_DEVELOPMENT);
-}
-
-static void
-greeter_populate_user_list (GtkTreeModel *tm)
-{
- GList *li;
-
- for (li = users; li != NULL; li = li->next) {
- GdmUser *usr = li->data;
- GtkTreeIter iter = {0};
- char *label;
- char *name;
- gboolean active;
-
- if (usr->gecos && strcmp (usr->gecos, "") != 0) {
- name = g_markup_escape_text (usr->gecos, -1);
- } else {
- name = g_markup_escape_text (usr->login, -1);
- }
-
- if (g_hash_table_lookup (displays_hash, usr->login))
- active = TRUE;
- else
- active = FALSE;
-
- if (active) {
- label = g_strdup_printf ("<b>%s</b>\n <i><small>%s</small></i>",
- name,
- _("Already logged in"));
- } else {
- label = g_strdup_printf ("<b>%s</b>\n",
- name);
- }
-
- g_free (name);
-
- gtk_list_store_append (GTK_LIST_STORE (tm), &iter);
- gtk_list_store_set (GTK_LIST_STORE (tm), &iter,
- GREETER_ULIST_ICON_COLUMN, usr->picture,
- GREETER_ULIST_LOGIN_COLUMN, usr->login,
- GREETER_ULIST_LABEL_COLUMN, label,
- GREETER_ULIST_ACTIVE_COLUMN, active,
- -1);
- g_free (label);
- num_users++;
- }
-}
-
-void
-greeter_item_ulist_select_user (gchar *login)
-{
- printf ("%c%c%c%s\n", STX, BEL,
- GDM_INTERRUPT_SELECT_USER, login);
-
- fflush (stdout);
-}
-
-static void
-user_selected (GtkTreeSelection *selection, gpointer data)
-{
- GtkTreeModel *tm = NULL;
- GtkTreeIter iter = {0};
-
- if (gtk_tree_selection_get_selected (selection, &tm, &iter)) {
- char *login;
-
- gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
- &login, -1);
- if (login != NULL) {
- if (selecting_user && greeter_probably_login_prompt) {
- gtk_entry_set_text (GTK_ENTRY (pam_entry), login);
- }
- if (selecting_user) {
- GreeterItemInfo *pamlabel = greeter_lookup_id ("pam-message");
- if (pamlabel == NULL) {
- gdm_common_warning ("Theme broken: must have pam-message label!");
- }
- greeter_item_ulist_select_user (login);
- if (selected_user != NULL)
- g_free (selected_user);
- selected_user = g_strdup (login);
- }
- }
- }
-}
-
-static void
-browser_change_focus (GtkWidget *widget, GdkEventButton *event, gpointer data)
-{
- gtk_widget_grab_focus (pam_entry);
-}
-
-static void
-greeter_generate_userlist (GtkWidget *tv)
-{
- GtkTreeModel *tm;
- GtkTreeViewColumn *column_one, *column_two;
- GtkTreeSelection *selection;
- GreeterItemInfo *info;
- GList *list, *li;
-
- gdm_greeter_users_init ();
-
- check_for_displays ();
-
- gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (tv),
- FALSE);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tv));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE);
- if (users != NULL) {
- g_signal_connect (selection, "changed",
- G_CALLBACK (user_selected),
- NULL);
-
- g_signal_connect (GTK_TREE_VIEW (tv), "button_release_event",
- G_CALLBACK (browser_change_focus),
- NULL);
-
- tm = (GtkTreeModel *)gtk_list_store_new (4,
- GDK_TYPE_PIXBUF,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_BOOLEAN);
- gtk_tree_view_set_model (GTK_TREE_VIEW (tv), tm);
- column_one = gtk_tree_view_column_new_with_attributes (_("Icon"),
- gtk_cell_renderer_pixbuf_new (),
- "pixbuf", GREETER_ULIST_ICON_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column_one);
-
- column_two = gtk_tree_view_column_new_with_attributes (_("Username"),
- gtk_cell_renderer_text_new (),
- "markup", GREETER_ULIST_LABEL_COLUMN,
- NULL);
- gtk_tree_view_append_column (GTK_TREE_VIEW (tv), column_two);
-
- greeter_populate_user_list (tm);
-
- info = greeter_lookup_id ("userlist");
-
- list = gtk_tree_view_column_get_cell_renderers (column_one);
- for (li = list; li != NULL; li = li->next) {
- GtkObject *cell = li->data;
-
- if (info->data.list.icon_color != NULL)
- g_object_set (cell, "cell-background",
- info->data.list.icon_color, NULL);
- }
-
- list = gtk_tree_view_column_get_cell_renderers (column_two);
- for (li = list; li != NULL; li = li->next) {
- GtkObject *cell = li->data;
-
- if (info->data.list.label_color != NULL)
- g_object_set (cell, "background",
- info->data.list.label_color, NULL);
- }
- }
-
- /* we are done with the hash */
- g_hash_table_destroy (displays_hash);
- displays_hash = NULL;
-}
-
-static inline void
-force_no_tree_separators (GtkWidget *widget)
-{
- gboolean first_time = TRUE;
-
- if (first_time) {
- gtk_rc_parse_string ("\n"
- " style \"gdm-userlist-treeview-style\"\n"
- " {\n"
- " GtkTreeView::horizontal-separator=0\n"
- " GtkTreeView::vertical-separator=0\n"
- " }\n"
- "\n"
- " widget \"*.gdm-userlist-treeview\" style \"gdm-userlist-treeview-style\"\n"
- "\n");
- first_time = FALSE;
- }
-
- gtk_widget_set_name (widget, "gdm-userlist-treeview");
-}
-
-gboolean
-greeter_item_ulist_setup (void)
-{
- GreeterItemInfo *info;
-
- info = greeter_lookup_id ("user-pw-entry");
- if (info && info->item &&
- GNOME_IS_CANVAS_WIDGET (info->item) &&
- GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (info->item)->widget)) {
- pam_entry = GNOME_CANVAS_WIDGET (info->item)->widget;
- }
-
- info = greeter_lookup_id ("userlist");
-
- if (info && info->item &&
- GNOME_IS_CANVAS_WIDGET (info->item)) {
- GtkWidget *sw = GNOME_CANVAS_WIDGET (info->item)->widget;
-
- if (GTK_IS_SCROLLED_WINDOW (sw) &&
- GTK_IS_TREE_VIEW (GTK_BIN (sw)->child)) {
- GtkRequisition req;
- gdouble height;
-
- user_list = GTK_BIN (sw)->child;
-
- force_no_tree_separators (user_list);
-
- greeter_generate_userlist (user_list);
-
- /* Reset size of the widget canvas item so it
- * is the same size as the userlist. This
- * avoids the ugly white background displayed
- * below the Face Browser when the list isn't
- * as large as the rectangle defined in the
- * GDM theme file.
- */
-
- gtk_widget_size_request (user_list, &req);
- g_object_get (info->item, "height", &height, NULL);
-
- if (req.height < height)
- g_object_set (info->item, "height", (double)req.height, NULL);
- }
- }
-
- return TRUE;
-}
-
-void
-greeter_item_ulist_enable (void)
-{
- selecting_user = TRUE;
- if (user_list != NULL)
- gtk_widget_set_sensitive (user_list, TRUE);
-}
-
-void
-greeter_item_ulist_disable (void)
-{
- selecting_user = FALSE;
- if (user_list != NULL)
- gtk_widget_set_sensitive (user_list, FALSE);
-}
-
-void
-greeter_item_ulist_set_user (const char *user)
-{
- gboolean old_selecting_user = selecting_user;
- GtkTreeSelection *selection;
- GtkTreeIter iter = {0};
- GtkTreeModel *tm = NULL;
-
- if (user_list == NULL)
- return;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (user_list));
- gtk_tree_selection_unselect_all (selection);
-
- if (ve_string_empty (user))
- return;
-
- /* Make sure we don't set the pam_entry and pam label stuff,
- this is programatic selection, not user selection */
- selecting_user = FALSE;
-
- tm = gtk_tree_view_get_model (GTK_TREE_VIEW (user_list));
-
- if (gtk_tree_model_get_iter_first (tm, &iter)) {
- do {
- char *login;
-
- gtk_tree_model_get (tm, &iter, GREETER_ULIST_LOGIN_COLUMN,
- &login, -1);
- if (login != NULL && strcmp (user, login) == 0) {
- GtkTreePath *path = gtk_tree_model_get_path (tm, &iter);
-
- gtk_tree_selection_select_iter (selection, &iter);
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (user_list),
- path, NULL,
- FALSE, 0.0, 0.0);
- gtk_tree_path_free (path);
- break;
- }
-
- } while (gtk_tree_model_iter_next (tm, &iter));
- }
- selecting_user = old_selecting_user;
-}
diff --git a/gui/greeter/greeter_item_ulist.h b/gui/greeter/greeter_item_ulist.h
deleted file mode 100644
index 8bf2b568..00000000
--- a/gui/greeter/greeter_item_ulist.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 GREETER_ITEM_ULIST_H
-#define GREETER_ITEM_ULIST_H
-
-#include "greeter_item.h"
-
-gboolean greeter_item_ulist_setup (void);
-void greeter_item_ulist_enable (void);
-void greeter_item_ulist_disable (void);
-void greeter_item_ulist_set_user (const char *user);
-void greeter_item_ulist_unset_selected_user (void);
-void greeter_item_ulist_select_user (gchar *login);
-void greeter_item_ulist_check_show_userlist (void);
-
-#endif
diff --git a/gui/greeter/greeter_parser.c b/gui/greeter/greeter_parser.c
deleted file mode 100644
index 0431f2df..00000000
--- a/gui/greeter/greeter_parser.c
+++ /dev/null
@@ -1,1911 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <libxml/parser.h>
-#include <string.h>
-#include <stdlib.h>
-#include <librsvg/rsvg.h>
-#include <math.h>
-#include <gdk/gdkx.h>
-#include <locale.h>
-#include <glib/gi18n.h>
-
-#include "gdmwm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "greeter_configuration.h"
-#include "greeter_parser.h"
-#include "greeter_events.h"
-#include "gdm.h"
-
-/* FIXME: hack */
-extern GreeterItemInfo *welcome_string_info;
-
-/* evil globals */
-static char *file_search_path = NULL;
-static GList *button_stack = NULL;
-
-static GHashTable *pixbuf_hash = NULL;
-
-GHashTable *item_hash = NULL;
-GList *custom_items = NULL;
-
-static gboolean parse_items (xmlNodePtr node,
- GList **items_out,
- GreeterItemInfo *parent,
- GError **error);
-
-static GdkPixbuf *
-load_pixbuf (const char *fname, GError **error)
-{
- GdkPixbuf *pb;
-
- if (pixbuf_hash == NULL)
- pixbuf_hash = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- (GDestroyNotify)g_object_unref);
- pb = g_hash_table_lookup (pixbuf_hash, fname);
- if (pb != NULL)
- return g_object_ref (pb);
-
- pb = gdk_pixbuf_new_from_file (fname, error);
- if G_UNLIKELY (pb == NULL)
- return NULL;
-
- g_hash_table_insert (pixbuf_hash, g_strdup (fname), g_object_ref (pb));
-
- return pb;
-}
-
-GQuark
-greeter_parser_error_quark (void)
-{
- static GQuark quark = 0;
- if (!quark)
- quark = g_quark_from_static_string ("greeter_parser_error");
-
- return quark;
-}
-
-
-GreeterItemInfo *
-greeter_lookup_id (const char *id)
-{
- GreeterItemInfo key;
- GreeterItemInfo *info;
-
- key.id = (char *)id;
- info = g_hash_table_lookup (item_hash, &key);
-
- return info;
-}
-
-static void
-parse_id (xmlNodePtr node,
- GreeterItemInfo *info)
-{
- xmlChar *prop;
-
- prop = xmlGetProp (node, (const xmlChar *) "id");
-
- if (prop)
- {
- info->id = g_strdup ((char *) prop);
- g_hash_table_insert (item_hash, info, info);
- xmlFree (prop);
- }
-}
-
-/* Doesn't set the parts of rect that are not specified.
- * If you want specific default values you need to fill them out
- * in rect first
- */
-static gboolean
-parse_pos (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- prop = xmlGetProp (node, (const xmlChar *) "anchor");
- if (prop)
- {
- if (strcmp ((char *) prop, "center") == 0)
- info->anchor = GTK_ANCHOR_CENTER;
- else if (strcmp ((char *) prop, "c") == 0)
- info->anchor = GTK_ANCHOR_CENTER;
- else if (strcmp ((char *) prop, "nw") == 0)
- info->anchor = GTK_ANCHOR_NW;
- else if (strcmp ((char *) prop, "n") == 0)
- info->anchor = GTK_ANCHOR_N;
- else if (strcmp ((char *) prop, "ne") == 0)
- info->anchor = GTK_ANCHOR_NE;
- else if (strcmp ((char *) prop, "w") == 0)
- info->anchor = GTK_ANCHOR_W;
- else if (strcmp ((char *) prop, "e") == 0)
- info->anchor = GTK_ANCHOR_E;
- else if (strcmp ((char *) prop, "sw") == 0)
- info->anchor = GTK_ANCHOR_SW;
- else if (strcmp ((char *) prop, "s") == 0)
- info->anchor = GTK_ANCHOR_S;
- else if (strcmp ((char *) prop, "se") == 0)
- info->anchor = GTK_ANCHOR_SE;
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Unknown anchor type %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
-
- prop = xmlGetProp (node,(const xmlChar *) "x");
- if (prop)
- {
- info->x = g_ascii_strtod ((char *) prop, &p);
-
- if ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad position specifier %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- if (prop[0] == '-' || info->x < 0)
- info->x_negative = TRUE;
- else
- info->x_negative = FALSE;
-
- if (strchr ((char *) prop, '%') != NULL)
- info->x_type = GREETER_ITEM_POS_RELATIVE;
- else
- info->x_type = GREETER_ITEM_POS_ABSOLUTE;
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "y");
- if (prop)
- {
- info->y = g_ascii_strtod ((char *) prop, &p);
-
- if ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad position specifier %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- if (prop[0] == '-' || info->y < 0)
- info->y_negative = TRUE;
- else
- info->y_negative = FALSE;
-
- if (strchr ((char *) prop, '%') != NULL)
- info->y_type = GREETER_ITEM_POS_RELATIVE;
- else
- info->y_type = GREETER_ITEM_POS_ABSOLUTE;
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "width");
- if (prop)
- {
- if (strcmp ((char *) prop, "box") == 0)
- info->width_type = GREETER_ITEM_SIZE_BOX;
- else if (strcmp ((char *) prop, "scale") == 0)
- info->width_type = GREETER_ITEM_SIZE_SCALE;
- else
- {
- info->width = g_ascii_strtod ((char *) prop, &p);
-
- if ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad size specifier %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- if (strchr ((char *) prop, '%') != NULL)
- info->width_type = GREETER_ITEM_SIZE_RELATIVE;
- else
- info->width_type = GREETER_ITEM_SIZE_ABSOLUTE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "height");
- if (prop)
- {
- if (strcmp ((char *) prop, "box") == 0)
- info->height_type = GREETER_ITEM_SIZE_BOX;
- else if (strcmp ((char *) prop, "scale") == 0)
- info->height_type = GREETER_ITEM_SIZE_SCALE;
- else
- {
- info->height = g_ascii_strtod ((char *) prop, &p);
-
- if ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad size specifier %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- if (strchr ((char *) prop, '%') != NULL)
- info->height_type = GREETER_ITEM_SIZE_RELATIVE;
- else
- info->height_type = GREETER_ITEM_SIZE_ABSOLUTE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "expand");
- if (prop)
- {
- if (strcmp ((char *) prop, "true") == 0)
- {
- info->expand = TRUE;
- }
- else if (strcmp ((char *) prop, "false") == 0)
- {
- info->expand = FALSE;
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad expand spec %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- xmlFree (prop);
- }
-
- return TRUE;
-}
-
-/* We pass the same arguments as to translated text, since we'll override it
- * with translation score */
-static gboolean
-parse_stock (xmlNodePtr node,
- GreeterItemInfo *info,
- char **translated_text,
- gint *translation_score,
- GError **error)
-{
- xmlChar *prop;
-
- prop = xmlGetProp (node,(const xmlChar *) "type");
- if (prop)
- {
- if (g_ascii_strcasecmp ((char *) prop, "language") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Language"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "session") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Session"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "system") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Actions"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "disconnect") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("D_isconnect"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "quit") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Quit"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "halt") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Shut _Down"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "suspend") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Sus_pend"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "reboot") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Restart"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "chooser") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Remote Login via _XDMCP"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "config") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Confi_gure"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "options") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Op_tions"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "caps-lock-warning") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Caps Lock is on."));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "timed-label") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("User %u will login in %t"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "welcome-label") == 0)
- {
- /* FIXME: hack */
- welcome_string_info = info;
-
- g_free (*translated_text);
- *translated_text = gdm_common_get_welcomemsg ();
- }
- /* FIXME: is this actually needed? */
- else if (g_ascii_strcasecmp ((char *) prop, "username-label") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("Username:"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "ok") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_OK"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "cancel") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Cancel"));
- }
- else if (g_ascii_strcasecmp ((char *) prop, "startagain") == 0)
- {
- g_free (*translated_text);
- *translated_text = g_strdup (_("_Start Again"));
- }
- else
- {
- gboolean is_error = TRUE;
- register int i = 0;
- for (; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gchar * key_string = NULL;
- key_string = g_strdup_printf (_("custom_cmd%d"), i);
- if (g_ascii_strcasecmp ((char *) prop, key_string) == 0) {
- g_free (*translated_text);
- g_free (key_string);
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- *translated_text = g_strdup(gdm_config_get_string (key_string));
- g_free (key_string);
- is_error = FALSE;
- break;
- }
- g_free (key_string);
- }
-
- if (is_error)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad stock label type");
- xmlFree (prop);
- return FALSE;
- }
- }
-
- /* This is the very very very best "translation" */
- *translation_score = -1;
-
- xmlFree (prop);
-
- return TRUE;
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Stock type not specified");
- return FALSE;
- }
-}
-
-static void
-do_font_size_reduction (GreeterItemInfo *info)
-{
- double size_reduction = 1.0;
- int i;
-
- if (gdm_wm_screen.width <= 800 &&
- gdm_wm_screen.width > 640)
- size_reduction = PANGO_SCALE_SMALL;
- else if (gdm_wm_screen.width <= 640)
- size_reduction = PANGO_SCALE_X_SMALL;
-
- if (size_reduction < 0.99)
- {
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if (info->data.text.fonts[i] != NULL)
- {
- int old_size = pango_font_description_get_size (info->data.text.fonts[i]);
- pango_font_description_set_size (info->data.text.fonts[i], old_size * size_reduction);
- }
- }
- }
-}
-
-
-static gboolean
-parse_canvasbutton (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
-
- prop = xmlGetProp (node,(const xmlChar *) "button");
- if (prop)
- {
- if (strcmp ((char *) prop, "true") == 0)
- {
- info->canvasbutton = TRUE;
- }
- else if (strcmp ((char *) prop, "false") == 0)
- {
- info->canvasbutton = FALSE;
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "bad button spec %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
- return TRUE;
-}
-
-static gboolean
-parse_gtkbutton (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- char *translated_text = NULL;
- gint translation_score = 1000;
-
- child = node->children;
-
- while (child)
- {
- if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- }
- else if (child->type == XML_ELEMENT_NODE &&
- strcmp ((char *) child->name, "stock") == 0)
- {
- if G_UNLIKELY (!parse_stock (child, info, &translated_text, &translation_score, error))
- return FALSE;
- }
-
- child = child->next;
- }
-
- if (translated_text == NULL)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "A label must specify the text attribute");
- return FALSE;
- }
-
- /* FIXME: evil hack to use internally translated strings */
- if (translation_score == 999 &&
- ! ve_string_empty (translated_text))
- {
- char *foo = g_strdup (_(translated_text));
- g_free (translated_text);
- translated_text = foo;
- }
-
- info->data.text.orig_text = translated_text;
-
- return TRUE;
-}
-
-static gboolean
-parse_show (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
- char **argv = NULL;
- int i;
-
- prop = xmlGetProp (node,(const xmlChar *) "type");
- if (prop != NULL)
- {
- g_free (info->show_type);
- info->show_type = g_strdup ((char *) prop);
- xmlFree (prop);
- }
-
- /* Note: subtype is deprecated, use type only */
- prop = xmlGetProp (node,(const xmlChar *) "subtype");
- if G_UNLIKELY (prop != NULL)
- {
- /* code for legacy uses of subtype only, are there any such
- * themes out there? The Bluecurve was the one this was made
- * for and bluecurve is NOT using it. */
- if (info->show_type == NULL ||
- strcmp (info->show_type, "system") == 0) {
- g_free (info->show_type);
- info->show_type = g_strdup ((char *) prop);
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "modes");
- if (prop != NULL)
- {
- if (strcmp ((char *) prop, "everywhere") == 0)
- {
- info->show_modes = GREETER_ITEM_SHOW_EVERYWHERE;
- xmlFree (prop);
- return TRUE;
- }
- else if (strcmp ((char *) prop, "nowhere") == 0)
- {
- info->show_modes = GREETER_ITEM_SHOW_NOWHERE;
- xmlFree (prop);
- return TRUE;
- }
-
- argv = g_strsplit ((char *) prop, ",", 0);
- xmlFree (prop);
- }
- else
- {
- info->show_modes = GREETER_ITEM_SHOW_EVERYWHERE;
- return TRUE;
- }
-
- info->show_modes = GREETER_ITEM_SHOW_NOWHERE;
-
- if (argv != NULL)
- {
- for (i = 0; argv[i] != NULL; i++)
- {
- if (strcmp (argv[i], "console") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_CONSOLE;
- }
- else if (strcmp (argv[i], "console-fixed") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_CONSOLE_FIXED;
- }
- else if (strcmp (argv[i], "console-flexi") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_CONSOLE_FLEXI;
- }
- else if (strcmp (argv[i], "remote-flexi") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_REMOTE_FLEXI;
- }
- else if (strcmp (argv[i], "flexi") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_FLEXI;
- }
- else if (strcmp (argv[i], "remote") == 0)
- {
- info->show_modes |= GREETER_ITEM_SHOW_REMOTE;
- }
- }
- g_strfreev (argv);
- }
- return TRUE;
-}
-
-static gboolean
-parse_fixed (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- return parse_items (node,
- &info->fixed_children,
- info,
- error);
-}
-
-static gboolean
-parse_box (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- prop = xmlGetProp (node,(const xmlChar *) "orientation");
- if (prop)
- {
- if (strcmp ((char *) prop, "horizontal") == 0)
- {
- info->box_orientation = GTK_ORIENTATION_HORIZONTAL;
- }
- else if (strcmp ((char *) prop, "vertical") == 0)
- {
- info->box_orientation = GTK_ORIENTATION_VERTICAL;
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad orientation %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "homogeneous");
- if (prop)
- {
- if (strcmp ((char *) prop, "true") == 0)
- {
- info->box_homogeneous = TRUE;
- }
- else if (strcmp ((char *) prop, "false") == 0)
- {
- info->box_homogeneous = FALSE;
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad homogenous spec %s", prop);
- xmlFree (prop);
- return FALSE;
- }
-
- xmlFree (prop);
- }
-
-
- prop = xmlGetProp (node,(const xmlChar *) "xpadding");
- if (prop)
- {
- info->box_x_padding = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad padding specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "ypadding");
- if (prop)
- {
- info->box_y_padding = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad padding specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "min-width");
- if (prop)
- {
- info->box_min_width = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad min-width specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "min-height");
- if (prop)
- {
- info->box_min_height = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad min-height specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "spacing");
- if (prop)
- {
- info->box_spacing = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad spacing specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- return parse_items (node,
- &info->box_children,
- info,
- error);
-
-}
-
-
-static gboolean
-parse_color (const char *str,
- guint32 *col_out,
- GError **error)
-{
- guint32 col;
- int i;
- if G_UNLIKELY (str[0] != '#')
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "colors must start with #, %s is an invalid color", str);
- return FALSE;
- }
- if G_UNLIKELY (strlen (str) != 7)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Colors must be on the format #xxxxxx, %s is an invalid color", str);
- return FALSE;
- }
-
- col = 0;
-
- for (i = 0; i < 6; i++)
- col = (col << 4) | g_ascii_xdigit_value (str[i+1]);
-
- *col_out = col;
-
- return TRUE;
-}
-
-static gboolean
-parse_state_file_pixmap (xmlNodePtr node,
- GreeterItemInfo *info,
- GreeterItemState state,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- info->have_state |= (1<<state);
-
- prop = xmlGetProp (node,(const xmlChar *) "file");
- if (prop)
- {
- if (g_path_is_absolute ((char *) prop))
- info->data.pixmap.files[state] = g_strdup ((char *) prop);
- else
- info->data.pixmap.files[state] = g_build_filename (file_search_path,
- (char *) prop,
- NULL);
-
- xmlFree (prop);
- }
-
- {
- int i = 1;
- char *altfile_prop_name = g_strdup_printf ("altfile%d", i);
-
- prop = xmlGetProp (node,(const xmlChar *) altfile_prop_name);
- while (prop)
- {
- char *filename = NULL;
- if (g_path_is_absolute ((char *) prop))
- filename = g_strdup ((char *) prop);
- else
- filename = g_build_filename (file_search_path,
- (char *) prop,
- NULL);
-
- if (g_file_test (filename, G_FILE_TEST_EXISTS))
- {
- if (info->data.pixmap.files[state])
- g_free (info->data.pixmap.files[state]);
- info->data.pixmap.files[state] = filename;
- }
- xmlFree (prop);
- g_free (altfile_prop_name);
-
- i++;
- altfile_prop_name = g_strdup_printf ("altfile%d", i);
- prop = xmlGetProp (node,(const xmlChar *) altfile_prop_name);
- }
- g_free (altfile_prop_name);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "tint");
- if (prop)
- {
- if (!parse_color ((char *) prop, &info->data.pixmap.tints[state], error))
- return FALSE;
- info->data.pixmap.have_tint |= (1<<state);
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "alpha");
- if (prop)
- {
- double alpha = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad alpha specifier format %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
-
- if (alpha >= 1.0)
- info->data.pixmap.alphas[state] = 0xff;
- else if (alpha < 0)
- info->data.pixmap.alphas[state] = 0;
- else
- info->data.pixmap.alphas[state] = floor (alpha * 0xff);
- }
-
- return TRUE;
-}
-
-static gboolean
-parse_state_color_rect (xmlNodePtr node,
- GreeterItemInfo *info,
- GreeterItemState state,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- info->have_state |= (1<<state);
-
- prop = xmlGetProp (node,(const xmlChar *) "color");
- if (prop)
- {
- if G_UNLIKELY (!parse_color ((char *) prop, &info->data.rect.colors[state], error))
- return FALSE;
- info->data.rect.have_color |= (1<<state);
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "alpha");
- if (prop)
- {
- double alpha = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad alpha specifier format %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
-
- if (alpha >= 1.0)
- info->data.rect.alphas[state] = 0xff;
- else if (alpha < 0)
- info->data.rect.alphas[state] = 0;
- else
- info->data.rect.alphas[state] = floor (alpha * 0xff);
- }
-
- return TRUE;
-}
-
-static gboolean
-parse_color_list (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
- guint32 color;
-
- prop = xmlGetProp (node,(const xmlChar *) "iconcolor");
- if (prop)
- {
- if G_UNLIKELY (!parse_color ((char *) prop, &color, error)) {
- info->data.list.icon_color = NULL;
- return FALSE;
- } else {
- info->data.list.icon_color = g_strdup ((char *) prop);
- }
-
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "labelcolor");
- if (prop)
- {
- if G_UNLIKELY (!parse_color ((char *) prop, &color, error)) {
- info->data.list.label_color = NULL;
- return FALSE;
- } else {
- info->data.list.label_color = g_strdup ((char *) prop);
- }
-
- xmlFree (prop);
- }
-
- return TRUE;
-}
-
-static gboolean
-parse_pixmap (xmlNodePtr node,
- gboolean svg,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- int i;
-
- child = node->children;
-
- while (child)
- {
- if (strcmp ((char *) child->name, "normal") == 0)
- {
- if G_UNLIKELY (!parse_state_file_pixmap (child, info, GREETER_ITEM_STATE_NORMAL, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "prelight") == 0)
- {
- if G_UNLIKELY (!parse_state_file_pixmap (child, info, GREETER_ITEM_STATE_PRELIGHT, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "active") == 0)
- {
- if G_UNLIKELY (!parse_state_file_pixmap (child, info, GREETER_ITEM_STATE_ACTIVE, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "fixed") == 0)
- {
- if G_UNLIKELY (!parse_fixed (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "box") == 0)
- {
- if G_UNLIKELY (!parse_box (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "show") == 0)
- {
- if G_UNLIKELY (!parse_show (child, info, error))
- return FALSE;
- }
-
- child = child->next;
- }
-
- if G_UNLIKELY (!info->data.pixmap.files[GREETER_ITEM_STATE_NORMAL])
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "No filename specified for normal state");
- return FALSE;
- }
-
- if (!svg)
- {
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if (info->data.pixmap.files[i] != NULL)
- {
- info->data.pixmap.pixbufs[i] = load_pixbuf (info->data.pixmap.files[i], error);
-
- if G_UNLIKELY (info->data.pixmap.pixbufs[i] == NULL)
- return FALSE;
- }
- else
- info->data.pixmap.pixbufs[i] = NULL;
- }
- }
-
- return TRUE;
-}
-
-static gboolean
-parse_rect (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- int i;
-
- child = node->children;
-
- while (child)
- {
- if (strcmp ((char *) child->name, "normal") == 0)
- {
- if G_UNLIKELY (!parse_state_color_rect (child, info, GREETER_ITEM_STATE_NORMAL, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "prelight") == 0)
- {
- if G_UNLIKELY (!parse_state_color_rect (child, info, GREETER_ITEM_STATE_PRELIGHT, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "active") == 0)
- {
- if G_UNLIKELY (!parse_state_color_rect (child, info, GREETER_ITEM_STATE_ACTIVE, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "fixed") == 0)
- {
- if G_UNLIKELY (!parse_fixed (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "box") == 0)
- {
- if G_UNLIKELY (!parse_box (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "show") == 0)
- {
- if G_UNLIKELY (!parse_show (child, info, error))
- return FALSE;
- }
-
- child = child->next;
- }
-
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if ( ! (info->data.rect.have_color & (1<<i)))
- continue;
-
- info->data.rect.colors[i] = (info->data.rect.colors[i] << 8) | (guint) info->data.rect.alphas[i];
- }
-
- return TRUE;
-}
-
-
-static gboolean
-parse_state_text (xmlNodePtr node,
- GreeterItemInfo *info,
- GreeterItemState state,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- info->have_state |= (1<<state);
-
- prop = xmlGetProp (node,(const xmlChar *) "font");
- if (prop)
- {
- info->data.text.fonts[state] = pango_font_description_from_string ((char *) prop);
- if G_UNLIKELY (info->data.text.fonts[state] == NULL)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad font specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "color");
- if (prop)
- {
- if G_UNLIKELY (!parse_color ((char *) prop, &info->data.text.colors[state], error))
- return FALSE;
- info->data.text.have_color |= (1<<state);
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "alpha");
- if (prop)
- {
- double alpha = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad alpha specifier format %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
-
- if (alpha >= 1.0)
- info->data.rect.alphas[state] = 0xff;
- else if (alpha < 0)
- info->data.rect.alphas[state] = 0;
- else
- info->data.rect.alphas[state] = floor (alpha * 0xff);
- }
-
- return TRUE;
-}
-
-static gint
-is_current_locale (const char *lang)
-{
- const GList *l = ve_i18n_get_language_list ("LC_MESSAGES");
- int score = 0;
-
- while (l != NULL)
- {
- if (strcmp (l->data, lang) == 0)
- return score;
-
- l = l->next;
- score++;
- }
- return 1000;
-}
-
-static gboolean
-parse_translated_text (xmlNodePtr node,
- char **translated_text,
- gint *translation_score,
- GError **error)
-{
- xmlChar *text;
- xmlChar *prop;
- gint score;
-
- prop = xmlNodeGetLang (node);
- if (prop)
- {
- score = is_current_locale ((char *) prop);
- xmlFree (prop);
- } else
- score = 999;
-
- if (score >= *translation_score)
- return TRUE;
-
- text = xmlNodeGetContent (node);
- if (text == NULL)
- {
- /* This is empty text */
- *translation_score = score;
- if (*translated_text)
- g_free (*translated_text);
- *translated_text = g_strdup ("");
-
- return TRUE;
- }
-
- *translation_score = score;
- if (*translated_text)
- g_free (*translated_text);
- *translated_text = g_strdup ((char *) text);
-
- xmlFree (text);
-
- return TRUE;
-}
-
-static gboolean
-parse_label_pos_extras (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlChar *prop;
- char *p;
-
- prop = xmlGetProp (node,(const xmlChar *) "max-width");
- if (prop)
- {
- info->data.text.max_width = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad max-width specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- prop = xmlGetProp (node,(const xmlChar *) "max-screen-percent-width");
- if (prop)
- {
- info->data.text.max_screen_percent_width = g_ascii_strtod ((char *) prop, &p);
-
- if G_UNLIKELY ((char *)prop == p)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad max-screen-percent-width specification %s", prop);
- xmlFree (prop);
- return FALSE;
- }
- xmlFree (prop);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-parse_label (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- int i;
- char *translated_text = NULL;
- gint translation_score = 1000;
-
- child = node->children;
- while (child)
- {
- if (strcmp ((char *) child->name, "normal") == 0)
- {
- if G_UNLIKELY (!parse_state_text (child, info, GREETER_ITEM_STATE_NORMAL, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "prelight") == 0)
- {
- if G_UNLIKELY (!parse_state_text (child, info, GREETER_ITEM_STATE_PRELIGHT, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "active") == 0)
- {
- if G_UNLIKELY (!parse_state_text (child, info, GREETER_ITEM_STATE_ACTIVE, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- if G_UNLIKELY (!parse_label_pos_extras (child, info, error))
- return FALSE;
- }
- else if (child->type == XML_ELEMENT_NODE &&
- strcmp ((char *) child->name, "text") == 0)
- {
- if G_UNLIKELY (!parse_translated_text (child, &translated_text, &translation_score, error))
- return FALSE;
- }
- else if (child->type == XML_ELEMENT_NODE &&
- strcmp ((char *) child->name, "stock") == 0)
- {
- if G_UNLIKELY (!parse_stock (child, info, &translated_text, &translation_score, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "show") == 0)
- {
- if G_UNLIKELY (!parse_show (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "fixed") == 0 ||
- strcmp ((char *) child->name, "box") == 0)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Label items cannot have children");
- return FALSE;
- }
-
- child = child->next;
- }
-
- if (translated_text == NULL)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "A label must specify the text attribute");
- return FALSE;
- }
- /* FIXME: evil hack to use internally translated strings */
- if (translation_score == 999 &&
- ! ve_string_empty (translated_text))
- {
- char *foo = g_strdup (_(translated_text));
- g_free (translated_text);
- translated_text = foo;
- }
-
- for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
- {
- if ( ! (info->data.text.have_color & (1<<i)))
- continue;
-
- info->data.text.colors[i] = (info->data.text.colors[i] << 8) | (guint) info->data.text.alphas[i];
- }
-
- if (info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] == NULL)
- info->data.text.fonts[GREETER_ITEM_STATE_NORMAL] = pango_font_description_from_string ("Sans");
-
- do_font_size_reduction (info);
-
- info->data.text.orig_text = translated_text;
-
- return TRUE;
-}
-
-static gboolean
-parse_listitem (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- xmlChar *prop;
- GreeterItemListItem *li;
- char *translated_text = NULL;
- gint translation_score = 1000;
-
- prop = xmlGetProp (node,(const xmlChar *) "id");
-
- if G_LIKELY (prop)
- {
- li = g_new0 (GreeterItemListItem, 1);
- li->id = g_strdup ((char *) prop);
- xmlFree (prop);
- }
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Listitem id not specified");
- return FALSE;
- }
-
- child = node->children;
- while (child)
- {
- if (child->type == XML_ELEMENT_NODE &&
- strcmp ((char *) child->name, "text") == 0)
- {
- if G_UNLIKELY ( ! parse_translated_text (child, &translated_text, &translation_score, error))
- {
- g_free (li->id);
- g_free (li);
- return FALSE;
- }
- }
-
- child = child->next;
- }
-
- if G_UNLIKELY (translated_text == NULL)
- {
- g_free (li->id);
- g_free (li);
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "A list item must specify the text attribute");
- return FALSE;
- }
- li->text = translated_text;
-
- info->data.list.items = g_list_append (info->data.list.items, li);
-
- return TRUE;
-}
-
-static gboolean
-parse_list (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
- xmlChar *prop;
-
- info->data.list.combo_type = FALSE;
- prop = xmlGetProp (node,(const xmlChar *) "combo");
- if (prop)
- {
- if (strcmp ((char *) prop, "true") == 0)
- {
- info->data.list.combo_type = TRUE;
- }
- else if (strcmp ((char *) prop, "false") == 0)
- {
- info->data.list.combo_type = FALSE;
- }
- xmlFree (prop);
- }
-
- child = node->children;
- while (child)
- {
- if (strcmp ((char *) child->name, "color") == 0)
- {
- if G_UNLIKELY (!parse_color_list (child, info, error))
- return FALSE;
- }
- if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "show") == 0)
- {
- if G_UNLIKELY (!parse_show (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "listitem") == 0)
- {
- if G_UNLIKELY ( ! parse_listitem (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "fixed") == 0 ||
- strcmp ((char *) child->name, "box") == 0)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "List items cannot have children");
- return FALSE;
- }
-
- child = child->next;
- }
-
- if ((strcmp (info->id, "userlist") == 0) && (info->data.list.combo_type == TRUE)) {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "userlist doest not support combo style");
- return FALSE;
- } else if (info->data.list.items != NULL) {
-
- if G_UNLIKELY (strcmp (info->id, "userlist") == 0 ||
- strcmp (info->id, "session") == 0 ||
- strcmp (info->id, "language") == 0) {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "List of id userlist, session, and language cannot have custom list items");
- return FALSE;
- }
- custom_items = g_list_append (custom_items, info);
-
- } else if (strcmp (info->id, "session") == 0 ||
- strcmp (info->id, "language") == 0) {
- custom_items = g_list_append (custom_items, info);
- }
-
- return TRUE;
-}
-
-static gboolean
-parse_entry (xmlNodePtr node,
- GreeterItemInfo *info,
- GError **error)
-{
- xmlNodePtr child;
-
- child = node->children;
- while (child)
- {
- if (strcmp ((char *) child->name, "normal") == 0)
- {
- if G_UNLIKELY (!parse_state_text (child, info, GREETER_ITEM_STATE_NORMAL, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "pos") == 0)
- {
- if G_UNLIKELY (!parse_pos (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "show") == 0)
- {
- if G_UNLIKELY (!parse_show (child, info, error))
- return FALSE;
- }
- else if (strcmp ((char *) child->name, "fixed") == 0 ||
- strcmp ((char *) child->name, "box") == 0)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Entry items cannot have children");
- return FALSE;
- }
-
- child = child->next;
- }
-
- do_font_size_reduction (info);
-
- return TRUE;
-}
-
-static gboolean
-parse_items (xmlNodePtr node,
- GList **items_out,
- GreeterItemInfo *parent,
- GError **error)
-{
- xmlNodePtr child;
- GList *items;
- gboolean res;
- xmlChar *type;
- GreeterItemInfo *info;
- GreeterItemType item_type;
-
- *items_out = NULL;
-
- items = NULL;
-
- child = node->children;
- while (child)
- {
- if (child->type == XML_ELEMENT_NODE)
- {
- if G_UNLIKELY (strcmp ((char *) child->name, "item") != 0)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Found tag %s when looking for item", child->name);
- return FALSE;
- }
-
- type = xmlGetProp (child, (const xmlChar *) "type");
- if G_UNLIKELY (!type)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Items must specify their type");
- return FALSE;
- }
-
- if (strcmp ((char *) type, "svg") == 0)
- item_type = GREETER_ITEM_TYPE_SVG;
- else if (strcmp ((char *) type, "pixmap") == 0)
- item_type = GREETER_ITEM_TYPE_PIXMAP;
- else if (strcmp ((char *) type, "rect") == 0)
- item_type = GREETER_ITEM_TYPE_RECT;
- else if (strcmp ((char *) type, "label") == 0)
- item_type = GREETER_ITEM_TYPE_LABEL;
- else if (strcmp ((char *) type, "entry") == 0)
- item_type = GREETER_ITEM_TYPE_ENTRY;
- else if (strcmp ((char *) type, "list") == 0)
- item_type = GREETER_ITEM_TYPE_LIST;
- else if (strcmp ((char *) type, "button") == 0)
- item_type = GREETER_ITEM_TYPE_BUTTON;
- else
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Unknown item type %s", type);
- xmlFree (type);
- return FALSE;
- }
-
- xmlFree (type);
-
- info = greeter_item_info_new (parent, item_type);
-
- parse_id (child, info);
- if G_UNLIKELY ( ! parse_canvasbutton (child, info, error))
- return FALSE;
-
- if (button_stack != NULL)
- info->my_button = button_stack->data;
- if (info->canvasbutton)
- button_stack = g_list_prepend (button_stack, info);
-
- switch (item_type)
- {
- case GREETER_ITEM_TYPE_SVG:
- res = parse_pixmap (child, TRUE, info, error);
- break;
- case GREETER_ITEM_TYPE_PIXMAP:
- res = parse_pixmap (child, FALSE, info, error);
- break;
- case GREETER_ITEM_TYPE_RECT:
- res = parse_rect (child, info, error);
- break;
- case GREETER_ITEM_TYPE_LABEL:
- res = parse_label (child, info, error);
- break;
- case GREETER_ITEM_TYPE_ENTRY:
- res = parse_entry (child, info, error);
- break;
- case GREETER_ITEM_TYPE_LIST:
- res = parse_list (child, info, error);
- break;
- case GREETER_ITEM_TYPE_BUTTON:
- res = parse_gtkbutton (child, info, error);
- break;
- default:
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_SPEC,
- "Bad item type");
- res = FALSE;
- }
-
- if (info->canvasbutton)
- button_stack = g_list_remove (button_stack, info);
-
- if G_UNLIKELY (!res)
- return FALSE;
-
- items = g_list_prepend (items, info);
-
- }
- child = child->next;
- }
-
- *items_out = g_list_reverse (items);
- return TRUE;
-}
-
-static gboolean
-greeter_info_id_equal (GreeterItemInfo *a,
- GreeterItemInfo *b)
-{
- return g_str_equal (a->id, b->id);
-}
-
-static guint
-greeter_info_id_hash (GreeterItemInfo *key)
-{
- return g_str_hash (key->id);
-}
-
-GreeterItemInfo *
-greeter_parse (const char *file, const char *datadir,
- GnomeCanvas *canvas,
- int width, int height, GError **error)
-{
- GreeterItemInfo *root;
- xmlDocPtr doc;
- xmlNodePtr node;
- xmlChar *prop;
- gboolean res;
- GList *items;
-
- /* FIXME: EVIL! GLOBAL! */
- g_free (file_search_path);
- file_search_path = g_strdup (datadir);
-
- if G_UNLIKELY (!g_file_test (file, G_FILE_TEST_EXISTS))
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_NO_FILE,
- "Can't open file %s", file);
- return NULL;
- }
-
-
- doc = xmlParseFile (file);
- if G_UNLIKELY (doc == NULL)
- {
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_XML,
- "XML Parse error reading %s", file);
- return NULL;
- }
-
- node = xmlDocGetRootElement (doc);
- if G_UNLIKELY (node == NULL)
- {
- xmlFreeDoc (doc);
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_BAD_XML,
- "Can't find the xml root node in file %s", file);
- return NULL;
- }
-
- if G_UNLIKELY (strcmp ((char *) node->name, "greeter") != 0)
- {
- xmlFreeDoc (doc);
- g_set_error (error,
- GREETER_PARSER_ERROR,
- GREETER_PARSER_ERROR_WRONG_TYPE,
- "The file %s has the wrong xml type", file);
- return NULL;
- }
-
- /*
- * The gtk-theme property specifies a theme specific gtk-theme to use
- */
- prop = xmlGetProp (node, (const xmlChar *) "gtk-theme");
- if (prop)
- {
- gchar *theme_dir;
-
- /*
- * It might be nice if we allowed this property to also supply a gtkrc file
- * that could be included in the theme. Perhaps we should check first in
- * the theme directory for a gtkrc file by the provided name and use that
- * if found.
- */
- theme_dir = g_strdup_printf ("%s/%s", gtk_rc_get_theme_dir (), (char *) prop);
- if (g_file_test (theme_dir, G_FILE_TEST_IS_DIR))
- gdm_set_theme ((char *) prop);
-
- xmlFree (prop);
- }
-
- item_hash = g_hash_table_new ((GHashFunc)greeter_info_id_hash,
- (GEqualFunc)greeter_info_id_equal);
-
-
- root = greeter_item_info_new (NULL, GREETER_ITEM_TYPE_RECT);
- res = parse_items (node, &items, root, error);
-
- /* Now we can whack the hash, we don't want to keep cached
- pixbufs around anymore */
- if (pixbuf_hash != NULL) {
- g_hash_table_destroy (pixbuf_hash);
- pixbuf_hash = NULL;
- }
-
- if G_UNLIKELY (!res)
- {
- welcome_string_info = NULL;
-
- g_hash_table_destroy (item_hash);
- item_hash = NULL;
- g_list_free (custom_items);
- custom_items = NULL;
-
- g_list_free (button_stack);
- button_stack = NULL;
-
- g_list_foreach (items, (GFunc) greeter_item_info_free, NULL);
- g_list_free (items);
- items = NULL;
-
- greeter_item_info_free (root);
-
- xmlFreeDoc (doc);
-
- return NULL;
- }
-
- xmlFreeDoc (doc);
-
- root->fixed_children = items;
-
- root->x = 0;
- root->y = 0;
- root->x_type = GREETER_ITEM_POS_ABSOLUTE;
- root->y_type = GREETER_ITEM_POS_ABSOLUTE;
-
- root->width = width;
- root->height = height;
- root->width_type = GREETER_ITEM_SIZE_ABSOLUTE;
- root->width_type = GREETER_ITEM_SIZE_ABSOLUTE;
-
- root->group_item = gnome_canvas_root (canvas);
-
- return root;
-}
-
-const GList *
-greeter_custom_items (void)
-{
- return custom_items;
-}
diff --git a/gui/greeter/greeter_parser.h b/gui/greeter/greeter_parser.h
deleted file mode 100644
index 15622ae8..00000000
--- a/gui/greeter/greeter_parser.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_PARSER_H__
-#define __GREETER_PARSER_H__
-
-#include <libgnomecanvas/libgnomecanvas.h>
-#include "greeter_item.h"
-
-
-typedef enum
-{
- GREETER_PARSER_ERROR_NO_FILE,
- GREETER_PARSER_ERROR_BAD_XML,
- GREETER_PARSER_ERROR_WRONG_TYPE,
- GREETER_PARSER_ERROR_BAD_SPEC
-} GreeterParseError;
-
-#define GREETER_PARSER_ERROR greeter_parser_error_quark()
-GQuark greeter_parser_error_quark (void);
-
-GreeterItemInfo *greeter_parse (const char *file,
- const char *data_dir,
- GnomeCanvas *canvas,
- int width,
- int height,
- GError **error);
-
-GreeterItemInfo *greeter_lookup_id (const char *id);
-const GList *greeter_custom_items (void);
-
-#endif /* __GREETER_PARSER_H__ */
diff --git a/gui/greeter/greeter_session.c b/gui/greeter/greeter_session.c
deleted file mode 100644
index 2bc812a3..00000000
--- a/gui/greeter/greeter_session.c
+++ /dev/null
@@ -1,268 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <string.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "gdm.h"
-#include "gdmwm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "gdmsession.h"
-
-#include "greeter.h"
-#include "greeter_session.h"
-#include "greeter_item_pam.h"
-#include "greeter_item_customlist.h"
-#include "greeter_configuration.h"
-#include "greeter_events.h"
-#include "greeter_parser.h"
-
-static GtkWidget *session_dialog;
-static GSList *session_group = NULL;
-extern GList *sessions;
-extern GHashTable *sessnames;
-extern gchar *default_session;
-extern char *current_session;
-extern gboolean session_dir_whacked_out;
-
-void
-greeter_set_session (char *session)
-{
- g_free (current_session);
- current_session = g_strdup (session);
- greeter_custom_set_session (session);
-}
-
-void
-greeter_session_init (void)
-{
- GtkWidget *w = NULL;
- GtkWidget *hbox = NULL;
- GtkWidget *main_vbox = NULL;
- GtkWidget *vbox = NULL;
- GtkWidget *cat_vbox = NULL;
- GtkWidget *radio;
- GtkWidget *dialog;
- GtkWidget *button;
- GList *tmp;
- static GtkTooltips *tooltips = NULL;
- GtkRequisition req;
- char *s;
- int num = 1;
- char *label;
-
- greeter_set_session (NULL);
-
- session_dialog = dialog = gtk_dialog_new ();
- if (tooltips == NULL)
- tooltips = gtk_tooltips_new ();
-
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL);
-
- button = gtk_button_new_with_mnemonic (_("Change _Session"));
- GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
- gtk_widget_show (button);
- gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
- GTK_RESPONSE_OK);
-
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
- main_vbox = gtk_vbox_new (FALSE, 18);
- gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- main_vbox,
- FALSE, FALSE, 0);
-
- cat_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (main_vbox),
- cat_vbox,
- FALSE, FALSE, 0);
-
- s = g_strdup_printf ("<b>%s</b>", _("Sessions"));
- w = gtk_label_new (s);
- gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
- g_free (s);
- gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (cat_vbox), w, FALSE, FALSE, 0);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (cat_vbox),
- hbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox),
- gtk_label_new (" "),
- FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 6);
- /* we will pack this later depending on size */
-
- if (gdm_config_get_bool (GDM_KEY_SHOW_LAST_SESSION))
- {
- greeter_set_session (LAST_SESSION);
-
- radio = gtk_radio_button_new_with_mnemonic (session_group, _("_Last session"));
- g_object_set_data (G_OBJECT (radio),
- SESSION_NAME,
- LAST_SESSION);
- session_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
- gtk_tooltips_set_tip (tooltips, radio,
- _("Log in using the session that you have used "
- "last time you logged in"),
- NULL);
- gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
- gtk_widget_show (radio);
- }
-
- gdm_session_list_init ();
-
- for (tmp = sessions; tmp != NULL; tmp = tmp->next)
- {
- GdmSession *session;
- char *file;
-
- file = (char *) tmp->data;
- session = g_hash_table_lookup (sessnames, file);
-
- if (num < 10 &&
- (strcmp (file, GDM_SESSION_FAILSAFE_GNOME) != 0) &&
- (strcmp (file, GDM_SESSION_FAILSAFE_XTERM) != 0))
- label = g_strdup_printf ("_%d. %s", num, session->name);
- else
- label = g_strdup (session->name);
- num++;
-
- radio = gtk_radio_button_new_with_mnemonic (session_group, label);
- g_free (label);
- g_object_set_data_full (G_OBJECT (radio), SESSION_NAME,
- file, (GDestroyNotify) g_free);
- session_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
- gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, FALSE, 0);
- gtk_widget_show (radio);
-
- if (! ve_string_empty (session->comment))
- gtk_tooltips_set_tip
- (tooltips, GTK_WIDGET (radio), session->comment, NULL);
- }
-
- gtk_widget_show_all (vbox);
- gtk_widget_size_request (vbox, &req);
-
- /* if too large */
- if (req.height > 0.7 * gdm_wm_screen.height) {
- GtkWidget *sw = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_set_size_request (sw,
- req.width,
- 0.7 * gdm_wm_screen.height);
- gtk_scrolled_window_set_shadow_type
- (GTK_SCROLLED_WINDOW (sw),
- GTK_SHADOW_NONE);
- gtk_scrolled_window_set_policy
- (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_NEVER,
- GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_add_with_viewport
- (GTK_SCROLLED_WINDOW (sw), vbox);
- gtk_widget_show (sw);
- gtk_box_pack_start (GTK_BOX (hbox),
- sw,
- TRUE, TRUE, 0);
- } else {
- gtk_box_pack_start (GTK_BOX (hbox),
- vbox,
- TRUE, TRUE, 0);
- }
-}
-
-/*
- * The button with this handler appears in the F10 menu, so it
- * cannot depend on callback data being passed in.
- */
-static void
-greeter_session_handler (GreeterItemInfo *info,
- gpointer user_data)
-{
- GSList *tmp;
- int ret;
-
- /* Select the proper session */
- tmp = session_group;
- while (tmp != NULL)
- {
- GtkWidget *w = tmp->data;
- const char *n;
-
- n = g_object_get_data (G_OBJECT (w), SESSION_NAME);
-
- if (n && strcmp (n, current_session) == 0)
- {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
- TRUE);
- break;
- }
-
- tmp = tmp->next;
- }
-
- gtk_widget_show_all (session_dialog);
-
- gdm_wm_center_window (GTK_WINDOW (session_dialog));
-
- gdm_wm_no_login_focus_push ();
- ret = gtk_dialog_run (GTK_DIALOG (session_dialog));
- gdm_wm_no_login_focus_pop ();
- gtk_widget_hide (session_dialog);
-
- if (ret == GTK_RESPONSE_OK)
- {
- tmp = session_group;
- while (tmp != NULL)
- {
- GtkWidget *w = tmp->data;
- const char *n;
-
- if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w)))
- {
- n = g_object_get_data (G_OBJECT (w), SESSION_NAME);
- greeter_set_session ((char *)n);
- break;
- }
-
- tmp = tmp->next;
- }
- }
-}
-
-void
-greeter_item_session_setup ()
-{
- greeter_item_register_action_callback ("session_button",
- (ActionFunc)greeter_session_handler,
- NULL);
-}
diff --git a/gui/greeter/greeter_session.h b/gui/greeter/greeter_session.h
deleted file mode 100644
index 43cf8f72..00000000
--- a/gui/greeter/greeter_session.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_SESSION_H__
-#define __GREETER_SESSION_H__
-
-void greeter_session_init (void);
-void greeter_item_session_setup (void);
-void greeter_set_session (char *session);
-
-#endif /* __GREETER_SESSION_H__ */
diff --git a/gui/greeter/greeter_system.c b/gui/greeter/greeter_system.c
deleted file mode 100644
index 0b5c21f2..00000000
--- a/gui/greeter/greeter_system.c
+++ /dev/null
@@ -1,533 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <unistd.h>
-#include <syslog.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "greeter.h"
-#include "greeter_configuration.h"
-#include "greeter_system.h"
-#include "greeter_item.h"
-#include "greeter_item_ulist.h"
-#include "greeter_parser.h"
-#include "gdm.h"
-#include "gdmcommon.h"
-#include "gdmconfig.h"
-#include "gdmwm.h"
-#include "misc.h"
-
-GtkWidget *dialog;
-extern gboolean GdmHaltFound;
-extern gboolean GdmRebootFound;
-extern gboolean *GdmCustomCmdsFound;
-extern gboolean GdmAnyCustomCmdsFound;
-extern gboolean GdmSuspendFound;
-extern gboolean GdmConfiguratorFound;
-
-/* doesn't check for executability, just for existance */
-static gboolean
-bin_exists (const char *command)
-{
- char *bin;
-
- if (ve_string_empty (command))
- return FALSE;
-
- /* Note, check only for existance, not for executability */
- bin = ve_first_word (command);
- if (bin != NULL &&
- g_access (bin, F_OK) == 0) {
- g_free (bin);
- return TRUE;
- } else {
- g_free (bin);
- return FALSE;
- }
-}
-
-/*
- * The buttons with these handlers appear in the F10 menu, so they
- * cannot depend on callback data being passed in.
- */
-static void
-query_greeter_restart_handler (void)
-{
- if (gdm_wm_warn_dialog (_("Are you sure you want to restart the computer?"), "",
- _("_Restart"), NULL, TRUE) == GTK_RESPONSE_YES) {
- closelog ();
-
- _exit (DISPLAY_REBOOT);
- }
-}
-
-static void
-query_greeter_custom_cmd_handler (GtkWidget *widget, gpointer data)
-{
- if (data) {
- gint *cmd_id = (gint*)data;
- gchar * key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TEXT_TEMPLATE, *cmd_id);
- if (gdm_wm_warn_dialog (gdm_config_get_string (key_string) , "",
- GTK_STOCK_OK, NULL, TRUE) == GTK_RESPONSE_YES) {
- printf ("%c%c%c%d\n", STX, BEL, GDM_INTERRUPT_CUSTOM_CMD, *cmd_id);
- fflush (stdout);
- }
- g_free (key_string);
- }
-}
-
-static void
-query_greeter_halt_handler (void)
-{
- if (gdm_wm_warn_dialog (_("Are you sure you want to Shut Down the computer?"), "",
- _("Shut _Down"), NULL, TRUE) == GTK_RESPONSE_YES) {
- closelog ();
-
- _exit (DISPLAY_HALT);
- }
-}
-
-static void
-query_greeter_suspend_handler (void)
-{
- if (gdm_wm_warn_dialog (_("Are you sure you want to suspend the computer?"), "",
- _("_Suspend"), NULL, TRUE) == GTK_RESPONSE_YES) {
- /* suspend interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_SUSPEND);
- fflush (stdout);
- }
-}
-
-static void
-greeter_restart_handler (void)
-{
- closelog ();
- _exit (DISPLAY_REBOOT);
-}
-
-static void
-greeter_custom_cmd_handler (gint cmd_id)
-{
- printf ("%c%c%c%d\n", STX, BEL, GDM_INTERRUPT_CUSTOM_CMD, cmd_id);
- fflush (stdout);
-}
-
-static void
-greeter_halt_handler (void)
-{
- closelog ();
- _exit (DISPLAY_HALT);
-}
-
-static void
-greeter_suspend_handler (void)
-{
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_SUSPEND);
- fflush (stdout);
-}
-
-static void
-greeter_config_handler (void)
-{
- greeter_item_ulist_disable ();
-
- /* Make sure to unselect the user */
- greeter_item_ulist_unset_selected_user ();
-
- /* we should be now fine for focusing new windows */
- gdm_wm_focus_new_windows (TRUE);
-
- /* configure interruption */
- printf ("%c%c%c\n", STX, BEL, GDM_INTERRUPT_CONFIGURE);
- fflush (stdout);
-}
-
-static void
-greeter_chooser_handler (void)
-{
- closelog ();
- _exit (DISPLAY_RUN_CHOOSER);
-}
-
-void
-greeter_system_append_system_menu (GtkWidget *menu)
-{
- GtkWidget *w, *sep;
- gint i = 0;
-
- /* should never be allowed by the UI */
- if ( ! gdm_config_get_bool (GDM_KEY_SYSTEM_MENU) ||
- ve_string_empty (g_getenv ("GDM_IS_LOCAL")))
- return;
-
- if (gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON)) {
- w = gtk_menu_item_new_with_mnemonic (_("Remote Login via _XDMCP..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (greeter_chooser_handler),
- NULL);
- }
-
- /*
- * Disable Configuration if using accessibility (AddGtkModules) since
- * using it with accessibility causes a hang.
- */
- if (gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE) &&
- !gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES) &&
- bin_exists (gdm_config_get_string (GDM_KEY_CONFIGURATOR))) {
- w = gtk_menu_item_new_with_mnemonic (_("Confi_gure Login Manager..."));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (greeter_config_handler),
- NULL);
- }
-
- if (GdmRebootFound || GdmHaltFound || GdmSuspendFound || GdmAnyCustomCmdsFound) {
- sep = gtk_separator_menu_item_new ();
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), sep);
- gtk_widget_show (sep);
- }
-
- if (GdmRebootFound) {
- w = gtk_menu_item_new_with_mnemonic (_("_Restart"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (query_greeter_restart_handler),
- NULL);
- }
-
- if (GdmAnyCustomCmdsFound) {
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- if (GdmCustomCmdsFound[i]){
- gint * cmd_index = g_new0(gint, 1);
- gchar * key_string = NULL;
- *cmd_index = i;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LABEL_TEMPLATE, i);
- w = gtk_menu_item_new_with_mnemonic (gdm_config_get_string(key_string));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (query_greeter_custom_cmd_handler),
- cmd_index);
- g_free (key_string);
- }
- }
- }
-
- if (GdmHaltFound) {
- w = gtk_menu_item_new_with_mnemonic (_("Shut _Down"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (query_greeter_halt_handler),
- NULL);
- }
-
- if (GdmSuspendFound) {
- w = gtk_menu_item_new_with_mnemonic (_("Sus_pend"));
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), w);
- gtk_widget_show (GTK_WIDGET (w));
- g_signal_connect (G_OBJECT (w), "activate",
- G_CALLBACK (query_greeter_suspend_handler),
- NULL);
- }
-}
-
-static gboolean
-radio_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- gpointer data)
-{
- if (event->type == GDK_2BUTTON_PRESS) {
- gtk_dialog_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK);
- }
- return FALSE;
-}
-
-static void
-greeter_system_handler (GreeterItemInfo *info,
- gpointer user_data)
-{
- GtkWidget *w = NULL;
- GtkWidget *hbox = NULL;
- GtkWidget *main_vbox = NULL;
- GtkWidget *vbox = NULL;
- GtkWidget *cat_vbox = NULL;
- GtkWidget *group_radio = NULL;
- GtkWidget *halt_radio = NULL;
- GtkWidget *suspend_radio = NULL;
- GtkWidget *restart_radio = NULL;
- GtkWidget **custom_cmds_radio = NULL;
- GtkWidget *config_radio = NULL;
- GtkWidget *chooser_radio = NULL;
- gchar *s;
- int ret;
- gint i;
- GSList *radio_group = NULL;
- static GtkTooltips *tooltips = NULL;
-
- /* should never be allowed by the UI */
- if ( ! gdm_config_get_bool (GDM_KEY_SYSTEM_MENU) ||
- ve_string_empty (g_getenv ("GDM_IS_LOCAL")))
- return;
-
- dialog = gtk_dialog_new ();
- if (tooltips == NULL)
- tooltips = gtk_tooltips_new ();
- gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
- gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-
- main_vbox = gtk_vbox_new (FALSE, 18);
- gtk_container_set_border_width (GTK_CONTAINER (main_vbox), 5);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
- main_vbox,
- FALSE, FALSE, 0);
-
- cat_vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (main_vbox),
- cat_vbox,
- FALSE, FALSE, 0);
-
- s = g_strdup_printf ("<b>%s</b>",
- _("Choose an Action"));
- w = gtk_label_new (s);
- gtk_label_set_use_markup (GTK_LABEL (w), TRUE);
- g_free (s);
- gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (cat_vbox), w, FALSE, FALSE, 0);
-
- hbox = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start (GTK_BOX (cat_vbox),
- hbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (hbox),
- gtk_label_new (" "),
- FALSE, FALSE, 0);
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (hbox),
- vbox,
- TRUE, TRUE, 0);
-
- if (GdmHaltFound) {
- if (group_radio != NULL)
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- halt_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("Shut _down the computer"));
- group_radio = halt_radio;
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (halt_radio),
- _("Shut Down your computer so that "
- "you may turn it off."),
- NULL);
- g_signal_connect (G_OBJECT(halt_radio), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- halt_radio,
- FALSE, FALSE, 4);
- gtk_widget_show (halt_radio);
- }
-
- if (GdmRebootFound) {
- if (group_radio != NULL)
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- restart_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("_Restart the computer"));
- group_radio = restart_radio;
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (restart_radio),
- _("Restart your computer"),
- NULL);
- g_signal_connect (G_OBJECT(restart_radio), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- restart_radio,
- FALSE, FALSE, 4);
- gtk_widget_show (restart_radio);
- }
-
- if (GdmAnyCustomCmdsFound) {
- custom_cmds_radio = g_new0 (GtkWidget*, GDM_CUSTOM_COMMAND_MAX);
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- custom_cmds_radio[i] = NULL;
- if (GdmCustomCmdsFound[i]){
- gchar * key_string = NULL;
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_LR_LABEL_TEMPLATE, i);
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- custom_cmds_radio[i] = gtk_radio_button_new_with_mnemonic (radio_group,
- gdm_config_get_string(key_string));
- group_radio = custom_cmds_radio[i];
- g_free (key_string);
- key_string = g_strdup_printf (_("%s%d="), GDM_KEY_CUSTOM_CMD_TOOLTIP_TEMPLATE, i);
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (custom_cmds_radio[i]),
- gdm_config_get_string(key_string),
- NULL);
- g_signal_connect (G_OBJECT(custom_cmds_radio[i]), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- custom_cmds_radio[i],
- FALSE, FALSE, 4);
- gtk_widget_show (custom_cmds_radio[i]);
- g_free (key_string);
- }
- }
- }
-
- if (GdmSuspendFound) {
- if (group_radio != NULL)
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- suspend_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("Sus_pend the computer"));
- group_radio = suspend_radio;
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (suspend_radio),
- _("Suspend your computer"),
- NULL);
- g_signal_connect (G_OBJECT(suspend_radio), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- suspend_radio,
- FALSE, FALSE, 4);
- gtk_widget_show (suspend_radio);
- }
-
- if (gdm_config_get_bool (GDM_KEY_CHOOSER_BUTTON)) {
- if (group_radio != NULL)
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- chooser_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("Run _XDMCP chooser"));
- group_radio = chooser_radio;
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (chooser_radio),
- _("Run an XDMCP chooser which will allow "
- "you to log into available remote "
- "computers, if there are any."),
- NULL);
- g_signal_connect (G_OBJECT(chooser_radio), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- chooser_radio,
- FALSE, FALSE, 4);
- gtk_widget_show (chooser_radio);
- }
-
- /*
- * Disable Configuration if using accessibility (AddGtkModules) since
- * using it with accessibility causes a hang.
- */
- if (gdm_config_get_bool (GDM_KEY_CONFIG_AVAILABLE) &&
- !gdm_config_get_bool (GDM_KEY_ADD_GTK_MODULES) &&
- bin_exists (gdm_config_get_string (GDM_KEY_CONFIGURATOR))) {
- if (group_radio != NULL)
- radio_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (group_radio));
- config_radio = gtk_radio_button_new_with_mnemonic (radio_group,
- _("Confi_gure the login manager"));
- group_radio = config_radio;
- gtk_tooltips_set_tip (tooltips, GTK_WIDGET (config_radio),
- _("Configure GDM (this login manager). "
- "This will require the root password."),
- NULL);
- g_signal_connect (G_OBJECT(config_radio), "button_press_event",
- G_CALLBACK(radio_button_press_event), NULL);
- gtk_box_pack_start (GTK_BOX (vbox),
- config_radio,
- FALSE, FALSE, 4);
- gtk_widget_show (config_radio);
- }
-
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_CANCEL);
-
- gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_OK,
- GTK_RESPONSE_OK);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog),
- GTK_RESPONSE_OK);
-
- gtk_widget_show_all (dialog);
- gdm_wm_center_window (GTK_WINDOW (dialog));
-
- gdm_wm_no_login_focus_push ();
- ret = gtk_dialog_run (GTK_DIALOG (dialog));
- gdm_wm_no_login_focus_pop ();
-
- if (ret != GTK_RESPONSE_OK)
- {
- gtk_widget_destroy (dialog);
- return;
- }
-
- if (halt_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (halt_radio)))
- greeter_halt_handler ();
- else if (restart_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (restart_radio)))
- greeter_restart_handler ();
- else if (suspend_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (suspend_radio)))
- greeter_suspend_handler ();
- else if (config_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (config_radio)))
- greeter_config_handler ();
- else if (chooser_radio != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (chooser_radio)))
- greeter_chooser_handler ();
- else
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- if (custom_cmds_radio[i] != NULL && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (custom_cmds_radio[i])))
- greeter_custom_cmd_handler (i);
- }
-
- gtk_widget_destroy (dialog);
-}
-
-
-void
-greeter_item_system_setup (void)
-{
- gint i;
-
- greeter_item_register_action_callback ("reboot_button",
- (ActionFunc)query_greeter_restart_handler,
- NULL);
- greeter_item_register_action_callback ("halt_button",
- (ActionFunc)query_greeter_halt_handler,
- NULL);
- greeter_item_register_action_callback ("suspend_button",
- (ActionFunc)query_greeter_suspend_handler,
- NULL);
- greeter_item_register_action_callback ("system_button",
- (ActionFunc)greeter_system_handler,
- NULL);
- greeter_item_register_action_callback ("config_button",
- (ActionFunc)greeter_config_handler,
- NULL);
- greeter_item_register_action_callback ("chooser_button",
- (ActionFunc)greeter_chooser_handler,
- NULL);
-
- for (i = 0; i < GDM_CUSTOM_COMMAND_MAX; i++) {
- gint * cmd_index = g_new0(gint, 1);
- gchar * key_string;
- *cmd_index = i;
- key_string = g_strdup_printf (_("custom_cmd_button%d"), i);
- greeter_item_register_action_callback (key_string,
- (ActionFunc)query_greeter_custom_cmd_handler,
- cmd_index);
- g_free (key_string);
- }
-}
diff --git a/gui/greeter/greeter_system.h b/gui/greeter/greeter_system.h
deleted file mode 100644
index 2349345c..00000000
--- a/gui/greeter/greeter_system.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/* GDM - The GNOME Display Manager
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 __GREETER_SYSTEM_H__
-#define __GREETER_SYSTEM_H__
-
-#include "greeter_item.h"
-#include "greeter_events.h"
-
-void greeter_item_system_setup (void);
-void greeter_system_append_system_menu (GtkWidget *menu);
-
-#endif
-
diff --git a/gui/greeter/themes/.cvsignore b/gui/greeter/themes/.cvsignore
deleted file mode 100644
index 22a4e729..00000000
--- a/gui/greeter/themes/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-
diff --git a/gui/greeter/themes/Makefile.am b/gui/greeter/themes/Makefile.am
deleted file mode 100644
index a27cf1ee..00000000
--- a/gui/greeter/themes/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = circles happygnome happygnome-list
-
diff --git a/gui/greeter/themes/circles/.cvsignore b/gui/greeter/themes/circles/.cvsignore
deleted file mode 100644
index d09a03b4..00000000
--- a/gui/greeter/themes/circles/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/circles/GdmGreeterTheme.desktop.in b/gui/greeter/themes/circles/GdmGreeterTheme.desktop.in
deleted file mode 100644
index b5699ab1..00000000
--- a/gui/greeter/themes/circles/GdmGreeterTheme.desktop.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# This is not really a .desktop file like the rest, but it's useful to treat
-# it as such
-
-[GdmGreeterTheme]
-Encoding=UTF-8
-Greeter=circles.xml
-_Name=Circles
-_Description=Theme with blue circles
-_Author=Bond, James Bond
-_Copyright=(c) 2002 Bond, James Bond
-Screenshot=screenshot.png
diff --git a/gui/greeter/themes/circles/Makefile.am b/gui/greeter/themes/circles/Makefile.am
deleted file mode 100644
index 0e8fa065..00000000
--- a/gui/greeter/themes/circles/Makefile.am
+++ /dev/null
@@ -1,19 +0,0 @@
-circlesdir = $(datadir)/gdm/themes/circles
-circles_DATA = \
- GdmGreeterTheme.desktop \
- circles.xml \
- background.svg \
- flower.png \
- help.png \
- options.png \
- screenshot.png
-
-circles_in_files = \
- GdmGreeterTheme.desktop.in
-
-@INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = $(circles_DATA) $(circles_in_files)
-
-clean-local:
- /bin/rm -f GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/circles/background.svg b/gui/greeter/themes/circles/background.svg
deleted file mode 100644
index 11abc4f4..00000000
--- a/gui/greeter/themes/circles/background.svg
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" [
- <!ENTITY st0 "fill:url(#aigrd1);stroke:none;">
- <!ENTITY st1 "fill:url(#aigrd3);stroke:none;">
- <!ENTITY st2 "fill:url(#aigrd2);stroke:none;">
- <!ENTITY st3 "fill-rule:nonzero;clip-rule:nonzero;fill:#2A569D;stroke:#000000;stroke-miterlimit:4;">
- <!ENTITY st4 "stroke:none;">
-]>
-<svg width="508.104pt" height="383.717pt" viewBox="0 0 508.104 383.717" xml:space="preserve">
- <g id="Layer_x0020_1" style="&st3;">
- <g id="middle">
- <linearGradient id="aigrd1" gradientUnits="userSpaceOnUse" x1="237.2617" y1="24.7095" x2="237.2617" y2="371.207">
- <stop offset="0" style="stop-color:#4E77B9"/>
- <stop offset="1" style="stop-color:#6E8CBE"/>
- </linearGradient>
- <path style="&st0;" d="M59.227,357.212c27.481,9.066,56.985,13.994,87.696,13.994c148.221,0,268.375-114.698,268.375-256.189c0-31.789-6.073-62.221-17.16-90.308C249.869,104.206,131.168,219.909,59.227,357.212z"/>
- </g>
- <linearGradient id="aigrd2" gradientUnits="userSpaceOnUse" x1="277.0767" y1="0" x2="277.0766" y2="383.7178">
- <stop offset="0" style="stop-color:#335EA2"/>
- <stop offset="1" style="stop-color:#6D8BBD"/>
- </linearGradient>
- <path id="lower_x0020_right" style="&st2;" d="M447.704,0c-16.859,7.792-33.389,16.037-49.566,24.709c11.087,28.087,17.16,58.52,17.16,90.308c0,141.491-120.154,256.189-268.375,256.189c-30.71,0-60.214-4.928-87.696-13.994
- c-4.584,8.749-8.979,17.585-13.178,26.505h462.056V0h-60.4z"/>
- <g id="upper_x0020_left">
- <linearGradient id="aigrd3" gradientUnits="userSpaceOnUse" x1="199.0684" y1="0" x2="199.0683" y2="357.2129">
- <stop offset="0" style="stop-color:#436FB6"/>
- <stop offset="1" style="stop-color:#305CA3"/>
- </linearGradient>
- <path style="&st1;" d="M398.137,24.709C394.798,16.252,391.011,8.005,386.791,0H0v329.44c18.309,11.454,38.174,20.827,59.227,27.772c71.942-137.304,190.642-253.007,338.911-332.503z"/>
- </g>
- <g id="bottom_x0020_small">
- <path style="&st4;" d="M0,329.44v54.277h46.048c4.2-8.92,8.594-17.756,13.178-26.505C38.174,350.267,18.309,340.894,0,329.44z"/>
- </g>
- <g id="top_x0020_small">
- <path style="&st4;" d="M447.704,0h-60.913c4.221,8.005,8.008,16.252,11.347,24.709C414.315,16.037,430.844,7.792,447.704,0z"/>
- </g>
- </g>
-</svg>
diff --git a/gui/greeter/themes/circles/circles.xml b/gui/greeter/themes/circles/circles.xml
deleted file mode 100644
index 696e7720..00000000
--- a/gui/greeter/themes/circles/circles.xml
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE greeter SYSTEM "greeter.dtd">
-<greeter>
- <item type="svg">
- <normal file="background.svg"/>
- <pos x="0" y="0" width="100%" height="-75"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos x="0" y="-75" width="100%" height="75"/>
- <fixed>
- <item type="rect">
- <normal color="#ffffff"/>
- <pos x="0" y="4" width="100%" height="100%"/>
- <box orientation="horizontal" spacing="10" xpadding="10" ypadding="10">
- <item type="button" id="options_button" button="true">
- <pos y="5" width="80" height="50"/>
- <stock type="options"/>
- </item>
- <item type="list" id="language" combo="true">
- <pos x="25" y="10" height="40" width="300"/>
- </item>
- <item type="list" id="session" combo="true">
- <pos x="50" y="10" height="40" width="300"/>
- </item>
- </box>
- </item>
- </fixed>
- </item>
-
- <item type="pixmap">
- <normal file="flower.png"/>
- <pos x="100%" y="100%" anchor="se"/>
- </item>
- <item type="label" id="clock">
- <normal color="#000000" font="Sans 12"/>
- <pos x="-20" y="-37" anchor="e"/>
- <text>%c</text>
- </item>
-
- <item type="rect">
- <show type="timed"/>
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="50%" y="25%" width="box" height="box"/>
- <box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
- <item type="label" id="timed-label">
- <normal color="#000000" font="Sans 12"/>
- <pos x="50%" anchor="n"/>
- <!-- Stock label for: User %s will login in %d seconds -->
- <stock type="timed-label"/>
- </item>
- </box>
- </item>
-
- <item type="rect">
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="50%" y="50%" width="box" height="box"/>
- <box orientation="vertical" min-width="340" xpadding="30" ypadding="30" spacing="10">
- <item type="label">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 14"/>
- <!-- Stock label for: Welcome to %h -->
- <stock type="welcome-label"/>
- </item>
- <item type="label" id="pam-prompt">
- <pos anchor="nw" x="10%"/>
- <normal color="#000000" font="Sans 12"/>
- <!-- Stock label for: Username: -->
- <stock type="username-label"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos anchor="n" x="50%" height="24" width="80%"/>
- <fixed>
- <item type="entry" id="user-pw-entry">
- <normal color="#000000" font="Sans 12"/>
- <pos anchor="nw" x="1" y="1" height="-2" width="-2"/>
- </item>
- </fixed>
- </item>
- <item type="button" id="ok_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="ok"/>
- </item>
- <item type="button" id="cancel_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="startagain"/>
- </item>
- <item type="label" id="pam-message">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </box>
- <fixed>
- <item type="label" id="pam-error">
- <pos anchor="n" x="50%" y="110%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </fixed>
- </item>
-</greeter>
-
-
diff --git a/gui/greeter/themes/circles/flower.png b/gui/greeter/themes/circles/flower.png
deleted file mode 100644
index 92d25f32..00000000
--- a/gui/greeter/themes/circles/flower.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/circles/help.png b/gui/greeter/themes/circles/help.png
deleted file mode 100644
index b38b48a6..00000000
--- a/gui/greeter/themes/circles/help.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/circles/options.png b/gui/greeter/themes/circles/options.png
deleted file mode 100644
index 3c08e02d..00000000
--- a/gui/greeter/themes/circles/options.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/circles/screenshot.png b/gui/greeter/themes/circles/screenshot.png
deleted file mode 100644
index 7120b03d..00000000
--- a/gui/greeter/themes/circles/screenshot.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/happygnome-list/.cvsignore b/gui/greeter/themes/happygnome-list/.cvsignore
deleted file mode 100644
index d09a03b4..00000000
--- a/gui/greeter/themes/happygnome-list/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/happygnome-list/GdmGreeterTheme.desktop.in b/gui/greeter/themes/happygnome-list/GdmGreeterTheme.desktop.in
deleted file mode 100644
index 908c6c7e..00000000
--- a/gui/greeter/themes/happygnome-list/GdmGreeterTheme.desktop.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# This is not really a .desktop file like the rest, but it's useful to treat
-# it as such
-
-[GdmGreeterTheme]
-Encoding=UTF-8
-Greeter=happygnome.xml
-_Name=Happy GNOME with Browser
-_Description=GNOME Art variation of Circles with a Face Browser
-_Author=GNOME Artists
-_Copyright=(c) 2002 GNOME
-Screenshot=screenshot.png
diff --git a/gui/greeter/themes/happygnome-list/Makefile.am b/gui/greeter/themes/happygnome-list/Makefile.am
deleted file mode 100644
index 42ba140f..00000000
--- a/gui/greeter/themes/happygnome-list/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-happygnomedir = $(datadir)/gdm/themes/happygnome-list
-happygnome_DATA = \
- GdmGreeterTheme.desktop \
- happygnome.xml \
- background.svg \
- gnome-logo.svg \
- options.png \
- screenshot.png
-
-happygnome_in_files = \
- GdmGreeterTheme.desktop.in
-
-@INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = $(happygnome_DATA) $(happygnome_in_files)
-
-clean-local:
- /bin/rm -f GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/happygnome-list/background.svg b/gui/greeter/themes/happygnome-list/background.svg
deleted file mode 100644
index 11abc4f4..00000000
--- a/gui/greeter/themes/happygnome-list/background.svg
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" [
- <!ENTITY st0 "fill:url(#aigrd1);stroke:none;">
- <!ENTITY st1 "fill:url(#aigrd3);stroke:none;">
- <!ENTITY st2 "fill:url(#aigrd2);stroke:none;">
- <!ENTITY st3 "fill-rule:nonzero;clip-rule:nonzero;fill:#2A569D;stroke:#000000;stroke-miterlimit:4;">
- <!ENTITY st4 "stroke:none;">
-]>
-<svg width="508.104pt" height="383.717pt" viewBox="0 0 508.104 383.717" xml:space="preserve">
- <g id="Layer_x0020_1" style="&st3;">
- <g id="middle">
- <linearGradient id="aigrd1" gradientUnits="userSpaceOnUse" x1="237.2617" y1="24.7095" x2="237.2617" y2="371.207">
- <stop offset="0" style="stop-color:#4E77B9"/>
- <stop offset="1" style="stop-color:#6E8CBE"/>
- </linearGradient>
- <path style="&st0;" d="M59.227,357.212c27.481,9.066,56.985,13.994,87.696,13.994c148.221,0,268.375-114.698,268.375-256.189c0-31.789-6.073-62.221-17.16-90.308C249.869,104.206,131.168,219.909,59.227,357.212z"/>
- </g>
- <linearGradient id="aigrd2" gradientUnits="userSpaceOnUse" x1="277.0767" y1="0" x2="277.0766" y2="383.7178">
- <stop offset="0" style="stop-color:#335EA2"/>
- <stop offset="1" style="stop-color:#6D8BBD"/>
- </linearGradient>
- <path id="lower_x0020_right" style="&st2;" d="M447.704,0c-16.859,7.792-33.389,16.037-49.566,24.709c11.087,28.087,17.16,58.52,17.16,90.308c0,141.491-120.154,256.189-268.375,256.189c-30.71,0-60.214-4.928-87.696-13.994
- c-4.584,8.749-8.979,17.585-13.178,26.505h462.056V0h-60.4z"/>
- <g id="upper_x0020_left">
- <linearGradient id="aigrd3" gradientUnits="userSpaceOnUse" x1="199.0684" y1="0" x2="199.0683" y2="357.2129">
- <stop offset="0" style="stop-color:#436FB6"/>
- <stop offset="1" style="stop-color:#305CA3"/>
- </linearGradient>
- <path style="&st1;" d="M398.137,24.709C394.798,16.252,391.011,8.005,386.791,0H0v329.44c18.309,11.454,38.174,20.827,59.227,27.772c71.942-137.304,190.642-253.007,338.911-332.503z"/>
- </g>
- <g id="bottom_x0020_small">
- <path style="&st4;" d="M0,329.44v54.277h46.048c4.2-8.92,8.594-17.756,13.178-26.505C38.174,350.267,18.309,340.894,0,329.44z"/>
- </g>
- <g id="top_x0020_small">
- <path style="&st4;" d="M447.704,0h-60.913c4.221,8.005,8.008,16.252,11.347,24.709C414.315,16.037,430.844,7.792,447.704,0z"/>
- </g>
- </g>
-</svg>
diff --git a/gui/greeter/themes/happygnome-list/gnome-logo.svg b/gui/greeter/themes/happygnome-list/gnome-logo.svg
deleted file mode 100644
index bdde1d1e..00000000
--- a/gui/greeter/themes/happygnome-list/gnome-logo.svg
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" ?>
-<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" [
- <!ENTITY st0 "fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;">
- <!ENTITY st1 "stroke:none;">
-]>
-<svg width="95.991pt" height="150.915pt" viewBox="0 0 95.991 150.915" xml:space="preserve">
- <g id="Layer_x0020_1" style="&st0;">
- <g style="&st1;">
- <g>
- <g>
- <path d="M86.068,0C61.466,0,56.851,35.041,70.691,35.041C84.529,35.041,110.671,0,86.068,0z"/>
- <path d="M45.217,30.699c7.369,0.45,15.454-28.122,1.604-26.325c-13.845,1.797-8.976,25.875-1.604,26.325z"/>
- <path d="M11.445,48.453c5.241-2.307,0.675-24.872-8.237-18.718c-8.908,6.155,2.996,21.024,8.237,18.718z"/>
- <path d="M26.212,36.642c6.239-1.272,6.581-26.864-4.545-22.273c-11.128,4.592-1.689,23.547,4.545,22.273z"/>
- <path id="newshape" d="M58.791,93.913c1.107,8.454-6.202,12.629-13.36,7.179C22.644,83.743,83.16,75.088,79.171,51.386c-3.311-19.674-63.676-13.617-70.55,17.167C3.968,89.374,27.774,118.26,52.614,118.26c12.22,0,26.315-11.034,28.952-25.012
- c2.014-10.659-23.699-6.388-22.775,0.665z"/>
- </g>
- </g>
- <g>
- <path d="M17.718,132.165l-1.49,2.857c-0.418-0.374-1.064-0.746-1.937-1.115c-0.873-0.369-1.623-0.555-2.25-0.555c-1.964,0-3.514,0.668-4.65,2.004c-1.137,1.337-1.705,3.127-1.705,5.37c0,2.135,0.557,3.841,1.671,5.117c1.114,1.276,2.63,1.915,4.549,1.915
- c1.264,0,2.305-0.346,3.124-1.037v-3.932h-2.781v-3.031h6.344v8.958c-0.847,0.692-1.938,1.231-3.271,1.618s-2.661,0.58-3.981,0.58c-2.868,0-5.142-0.941-6.822-2.824s-2.52-4.369-2.52-7.459c0-3.092,0.914-5.604,2.743-7.536c1.828-1.933,4.289-2.899,7.382-2.899
- c2.192,0,4.057,0.656,5.594,1.969z"/>
- <path d="M34.892,150.853l-9.719-12.688v12.406h-3.406V130.54h1.719l9.438,12.094V130.54h3.406v20.313h-1.438z"/>
- <path d="M39.487,140.392c0-2.852,0.781-5.264,2.345-7.236c1.563-1.973,3.652-2.959,6.268-2.959c2.881,0,5.082,0.893,6.604,2.679c1.522,1.786,2.283,4.292,2.283,7.517c0,3.227-0.795,5.786-2.385,7.682c-1.592,1.895-3.85,2.842-6.775,2.842
- c-2.688,0-4.75-0.938-6.186-2.814s-2.153-4.447-2.153-7.709z M43.175,140.392c0,2.342,0.396,4.155,1.19,5.439c0.793,1.285,1.947,1.928,3.461,1.928c1.779,0,3.136-0.629,4.07-1.887c0.936-1.257,1.402-3.084,1.402-5.48c0-4.692-1.732-7.039-5.199-7.039
- c-1.587,0-2.805,0.636-3.653,1.906c-0.849,1.271-1.272,2.982-1.272,5.133z"/>
- <path d="M78.831,150.571h-3.438l-2.094-10.781l-4.031,11.063h-1.281L63.94,139.79l-2.141,10.781h-3.438l4.031-20.031h1.875l4.359,13.5l4.234-13.5h1.875l4.094,20.031z"/>
- <path d="M84.569,133.696v4.688h6.438v3.031h-6.438v6h9.063v3.156H81.006V130.54h12.625v3.156h-9.063z"/>
- </g>
- </g>
- </g>
-</svg>
diff --git a/gui/greeter/themes/happygnome-list/happygnome.xml b/gui/greeter/themes/happygnome-list/happygnome.xml
deleted file mode 100644
index ad9f26fa..00000000
--- a/gui/greeter/themes/happygnome-list/happygnome.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE greeter SYSTEM "greeter.dtd">
-<greeter>
- <item type="svg">
- <normal file="background.svg"/>
- <pos x="0" y="0" width="100%" height="-75"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos x="0" y="-75" width="100%" height="75"/>
- <fixed>
- <item type="rect">
- <normal color="#ffffff"/>
- <pos x="0" y="4" width="100%" height="100%"/>
- <box orientation="horizontal" spacing="10" xpadding="10" ypadding="10">
- <item type="button" id="options_button">
- <pos width="100" height="50" />
- <stock type="options"/>
- </item>
- <item type="list" id="language" combo="true">
- <pos x="25" y="5" height="40" width="300"/>
- </item>
- <item type="list" id="session" combo="true">
- <pos x="50" y="5" height="40" width="300"/>
- </item>
- </box>
- </item>
- </fixed>
- </item>
- <item type="svg">
- <normal file="gnome-logo.svg"/>
- <pos x="-12" y="-12" width="30" height="47" anchor="se" />
- </item>
- <item type="label" id="clock">
- <normal color="#000000" font="Sans 12"/>
- <pos x="-80" y="-37" anchor="e"/>
- <text>%c</text>
- </item>
-
- <item type="rect" id="caps-lock-warning">
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="75%" y="75%" width="box" height="box"/>
- <box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
- <item type="label">
- <normal color="#000000" font="Sans 12"/>
- <pos x="50%" anchor="n"/>
- <!-- Stock label for: You've got capslock on! -->
- <stock type="caps-lock-warning"/>
- </item>
- </box>
- </item>
-
- <item type="rect">
- <show type="timed"/>
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="75%" y="25%" width="box" height="box"/>
- <box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
- <item type="label" id="timed-label">
- <normal color="#000000" font="Sans 12"/>
- <pos x="50%" anchor="n"/>
- <!-- Stock label for: User %s will login in %d seconds -->
- <stock type="timed-label"/>
- </item>
- </box>
- </item>
-
- <item type="rect" id="userlist-rect">
- <normal color="#FFFFFF" alpha="0.5" font="Sans 14"/>
- <pos anchor="c" x="25%" y="50%" width="box" height="box"/>
- <box orientation="vertical" min-width="440" max-width="440" min-height="100" xpadding="4" ypadding="4" spacing="0">
- <item type="list" id="userlist">
- <pos anchor="nw" x="0" y="0" height="550" width="440"/>
- <color iconcolor="#ACBFDD" labelcolor="#ACBFDD"/>
- </item>
- </box>
- </item>
-
- <item type="rect">
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="75%" y="50%" width="box" height="box"/>
- <box orientation="vertical" min-width="340" xpadding="30" ypadding="30" spacing="10">
- <item type="label">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 18"/>
- <!-- Stock label for: Welcome to %h -->
- <stock type="welcome-label"/>
- </item>
- <item type="label" id="pam-prompt">
- <pos anchor="nw" x="10%"/>
- <normal color="#000000" font="Sans 12"/>
- <!-- Stock label for: Username: -->
- <stock type="username-label"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos anchor="n" x="50%" height="24" width="80%"/>
- <fixed>
- <item type="entry" id="user-pw-entry">
- <normal color="#000000" font="Sans 12"/>
- <pos anchor="nw" x="1" y="1" height="-2" width="-2"/>
- </item>
- </fixed>
- </item>
- <item type="button" id="ok_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="ok"/>
- </item>
- <item type="button" id="cancel_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="startagain"/>
- </item>
- <item type="label" id="pam-message">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </box>
- <fixed>
- <item type="label" id="pam-error">
- <pos anchor="n" x="50%" y="110%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </fixed>
- </item>
-</greeter>
-
-
diff --git a/gui/greeter/themes/happygnome-list/options.png b/gui/greeter/themes/happygnome-list/options.png
deleted file mode 100644
index 431813fa..00000000
--- a/gui/greeter/themes/happygnome-list/options.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/happygnome-list/screenshot.png b/gui/greeter/themes/happygnome-list/screenshot.png
deleted file mode 100644
index 0e9390fc..00000000
--- a/gui/greeter/themes/happygnome-list/screenshot.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/happygnome/.cvsignore b/gui/greeter/themes/happygnome/.cvsignore
deleted file mode 100644
index d09a03b4..00000000
--- a/gui/greeter/themes/happygnome/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-Makefile
-Makefile.in
-GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/happygnome/GdmGreeterTheme.desktop.in b/gui/greeter/themes/happygnome/GdmGreeterTheme.desktop.in
deleted file mode 100644
index d95ac06d..00000000
--- a/gui/greeter/themes/happygnome/GdmGreeterTheme.desktop.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# This is not really a .desktop file like the rest, but it's useful to treat
-# it as such
-
-[GdmGreeterTheme]
-Encoding=UTF-8
-Greeter=happygnome.xml
-_Name=Happy GNOME
-_Description=GNOME Art variation of Circles
-_Author=GNOME Artists
-_Copyright=(c) 2002 GNOME
-Screenshot=screenshot.png
diff --git a/gui/greeter/themes/happygnome/Makefile.am b/gui/greeter/themes/happygnome/Makefile.am
deleted file mode 100644
index 19981eb7..00000000
--- a/gui/greeter/themes/happygnome/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-happygnomedir = $(datadir)/gdm/themes/happygnome
-happygnome_DATA = \
- GdmGreeterTheme.desktop \
- happygnome.xml \
- background.svg \
- gnome-logo.svg \
- options.png \
- screenshot.png
-
-happygnome_in_files = \
- GdmGreeterTheme.desktop.in
-
-@INTLTOOL_DESKTOP_RULE@
-
-EXTRA_DIST = $(happygnome_DATA) $(happygnome_in_files)
-
-clean-local:
- /bin/rm -f GdmGreeterTheme.desktop
diff --git a/gui/greeter/themes/happygnome/background.svg b/gui/greeter/themes/happygnome/background.svg
deleted file mode 100644
index 11abc4f4..00000000
--- a/gui/greeter/themes/happygnome/background.svg
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" [
- <!ENTITY st0 "fill:url(#aigrd1);stroke:none;">
- <!ENTITY st1 "fill:url(#aigrd3);stroke:none;">
- <!ENTITY st2 "fill:url(#aigrd2);stroke:none;">
- <!ENTITY st3 "fill-rule:nonzero;clip-rule:nonzero;fill:#2A569D;stroke:#000000;stroke-miterlimit:4;">
- <!ENTITY st4 "stroke:none;">
-]>
-<svg width="508.104pt" height="383.717pt" viewBox="0 0 508.104 383.717" xml:space="preserve">
- <g id="Layer_x0020_1" style="&st3;">
- <g id="middle">
- <linearGradient id="aigrd1" gradientUnits="userSpaceOnUse" x1="237.2617" y1="24.7095" x2="237.2617" y2="371.207">
- <stop offset="0" style="stop-color:#4E77B9"/>
- <stop offset="1" style="stop-color:#6E8CBE"/>
- </linearGradient>
- <path style="&st0;" d="M59.227,357.212c27.481,9.066,56.985,13.994,87.696,13.994c148.221,0,268.375-114.698,268.375-256.189c0-31.789-6.073-62.221-17.16-90.308C249.869,104.206,131.168,219.909,59.227,357.212z"/>
- </g>
- <linearGradient id="aigrd2" gradientUnits="userSpaceOnUse" x1="277.0767" y1="0" x2="277.0766" y2="383.7178">
- <stop offset="0" style="stop-color:#335EA2"/>
- <stop offset="1" style="stop-color:#6D8BBD"/>
- </linearGradient>
- <path id="lower_x0020_right" style="&st2;" d="M447.704,0c-16.859,7.792-33.389,16.037-49.566,24.709c11.087,28.087,17.16,58.52,17.16,90.308c0,141.491-120.154,256.189-268.375,256.189c-30.71,0-60.214-4.928-87.696-13.994
- c-4.584,8.749-8.979,17.585-13.178,26.505h462.056V0h-60.4z"/>
- <g id="upper_x0020_left">
- <linearGradient id="aigrd3" gradientUnits="userSpaceOnUse" x1="199.0684" y1="0" x2="199.0683" y2="357.2129">
- <stop offset="0" style="stop-color:#436FB6"/>
- <stop offset="1" style="stop-color:#305CA3"/>
- </linearGradient>
- <path style="&st1;" d="M398.137,24.709C394.798,16.252,391.011,8.005,386.791,0H0v329.44c18.309,11.454,38.174,20.827,59.227,27.772c71.942-137.304,190.642-253.007,338.911-332.503z"/>
- </g>
- <g id="bottom_x0020_small">
- <path style="&st4;" d="M0,329.44v54.277h46.048c4.2-8.92,8.594-17.756,13.178-26.505C38.174,350.267,18.309,340.894,0,329.44z"/>
- </g>
- <g id="top_x0020_small">
- <path style="&st4;" d="M447.704,0h-60.913c4.221,8.005,8.008,16.252,11.347,24.709C414.315,16.037,430.844,7.792,447.704,0z"/>
- </g>
- </g>
-</svg>
diff --git a/gui/greeter/themes/happygnome/gnome-logo.svg b/gui/greeter/themes/happygnome/gnome-logo.svg
deleted file mode 100644
index bdde1d1e..00000000
--- a/gui/greeter/themes/happygnome/gnome-logo.svg
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="us-ascii" ?>
-<!-- Generator: Adobe Illustrator 9.0, SVG Export Plug-In -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-stylable.dtd" [
- <!ENTITY st0 "fill-rule:nonzero;clip-rule:nonzero;stroke:#000000;stroke-miterlimit:4;">
- <!ENTITY st1 "stroke:none;">
-]>
-<svg width="95.991pt" height="150.915pt" viewBox="0 0 95.991 150.915" xml:space="preserve">
- <g id="Layer_x0020_1" style="&st0;">
- <g style="&st1;">
- <g>
- <g>
- <path d="M86.068,0C61.466,0,56.851,35.041,70.691,35.041C84.529,35.041,110.671,0,86.068,0z"/>
- <path d="M45.217,30.699c7.369,0.45,15.454-28.122,1.604-26.325c-13.845,1.797-8.976,25.875-1.604,26.325z"/>
- <path d="M11.445,48.453c5.241-2.307,0.675-24.872-8.237-18.718c-8.908,6.155,2.996,21.024,8.237,18.718z"/>
- <path d="M26.212,36.642c6.239-1.272,6.581-26.864-4.545-22.273c-11.128,4.592-1.689,23.547,4.545,22.273z"/>
- <path id="newshape" d="M58.791,93.913c1.107,8.454-6.202,12.629-13.36,7.179C22.644,83.743,83.16,75.088,79.171,51.386c-3.311-19.674-63.676-13.617-70.55,17.167C3.968,89.374,27.774,118.26,52.614,118.26c12.22,0,26.315-11.034,28.952-25.012
- c2.014-10.659-23.699-6.388-22.775,0.665z"/>
- </g>
- </g>
- <g>
- <path d="M17.718,132.165l-1.49,2.857c-0.418-0.374-1.064-0.746-1.937-1.115c-0.873-0.369-1.623-0.555-2.25-0.555c-1.964,0-3.514,0.668-4.65,2.004c-1.137,1.337-1.705,3.127-1.705,5.37c0,2.135,0.557,3.841,1.671,5.117c1.114,1.276,2.63,1.915,4.549,1.915
- c1.264,0,2.305-0.346,3.124-1.037v-3.932h-2.781v-3.031h6.344v8.958c-0.847,0.692-1.938,1.231-3.271,1.618s-2.661,0.58-3.981,0.58c-2.868,0-5.142-0.941-6.822-2.824s-2.52-4.369-2.52-7.459c0-3.092,0.914-5.604,2.743-7.536c1.828-1.933,4.289-2.899,7.382-2.899
- c2.192,0,4.057,0.656,5.594,1.969z"/>
- <path d="M34.892,150.853l-9.719-12.688v12.406h-3.406V130.54h1.719l9.438,12.094V130.54h3.406v20.313h-1.438z"/>
- <path d="M39.487,140.392c0-2.852,0.781-5.264,2.345-7.236c1.563-1.973,3.652-2.959,6.268-2.959c2.881,0,5.082,0.893,6.604,2.679c1.522,1.786,2.283,4.292,2.283,7.517c0,3.227-0.795,5.786-2.385,7.682c-1.592,1.895-3.85,2.842-6.775,2.842
- c-2.688,0-4.75-0.938-6.186-2.814s-2.153-4.447-2.153-7.709z M43.175,140.392c0,2.342,0.396,4.155,1.19,5.439c0.793,1.285,1.947,1.928,3.461,1.928c1.779,0,3.136-0.629,4.07-1.887c0.936-1.257,1.402-3.084,1.402-5.48c0-4.692-1.732-7.039-5.199-7.039
- c-1.587,0-2.805,0.636-3.653,1.906c-0.849,1.271-1.272,2.982-1.272,5.133z"/>
- <path d="M78.831,150.571h-3.438l-2.094-10.781l-4.031,11.063h-1.281L63.94,139.79l-2.141,10.781h-3.438l4.031-20.031h1.875l4.359,13.5l4.234-13.5h1.875l4.094,20.031z"/>
- <path d="M84.569,133.696v4.688h6.438v3.031h-6.438v6h9.063v3.156H81.006V130.54h12.625v3.156h-9.063z"/>
- </g>
- </g>
- </g>
-</svg>
diff --git a/gui/greeter/themes/happygnome/happygnome.xml b/gui/greeter/themes/happygnome/happygnome.xml
deleted file mode 100644
index 1d14dcbb..00000000
--- a/gui/greeter/themes/happygnome/happygnome.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE greeter SYSTEM "greeter.dtd">
-<greeter>
- <item type="svg">
- <normal file="background.svg"/>
- <pos x="0" y="0" width="100%" height="-75"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos x="0" y="-75" width="100%" height="75"/>
- <fixed>
- <item type="rect">
- <normal color="#ffffff"/>
- <pos x="0" y="4" width="100%" height="100%"/>
- <box orientation="horizontal" spacing="10" xpadding="10" ypadding="10">
- <item type="button" id="options_button">
- <pos width="100" height="50" />
- <stock type="options"/>
- </item>
- <item type="list" id="language" combo="true">
- <pos x="25" y="5" height="40" width="300"/>
- </item>
- <item type="list" id="session" combo="true">
- <pos x="50" y="5" height="40" width="300"/>
- </item>
- </box>
- </item>
- </fixed>
- </item>
- <item type="svg">
- <normal file="gnome-logo.svg"/>
- <pos x="-12" y="-12" width="30" height="47" anchor="se" />
- </item>
- <item type="label" id="clock">
- <normal color="#000000" font="Sans 12"/>
- <pos x="-80" y="-37" anchor="e"/>
- <text>%c</text>
- </item>
-
- <item type="rect" id="caps-lock-warning">
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="50%" y="75%" width="box" height="box"/>
- <box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
- <item type="label">
- <normal color="#000000" font="Sans 12"/>
- <pos x="50%" anchor="n"/>
- <!-- Stock label for: You've got capslock on! -->
- <stock type="caps-lock-warning"/>
- </item>
- </box>
- </item>
-
- <item type="rect">
- <show type="timed"/>
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="50%" y="25%" width="box" height="box"/>
- <box orientation="vertical" min-width="400" xpadding="10" ypadding="5" spacing="0">
- <item type="label" id="timed-label">
- <normal color="#000000" font="Sans 12"/>
- <pos x="50%" anchor="n"/>
- <!-- Stock label for: User %s will login in %d seconds -->
- <stock type="timed-label"/>
- </item>
- </box>
- </item>
-
- <item type="rect">
- <normal color="#FFFFFF" alpha="0.5"/>
- <pos anchor="c" x="50%" y="50%" width="box" height="box"/>
- <box orientation="vertical" min-width="340" xpadding="30" ypadding="30" spacing="10">
- <item type="label">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 14"/>
- <!-- Stock label for: Welcome to %h -->
- <stock type="welcome-label"/>
- </item>
- <item type="label" id="pam-prompt">
- <pos anchor="nw" x="10%"/>
- <normal color="#000000" font="Sans 12"/>
- <!-- Stock label for: Username: -->
- <stock type="username-label"/>
- </item>
- <item type="rect">
- <normal color="#000000"/>
- <pos anchor="n" x="50%" height="24" width="80%"/>
- <fixed>
- <item type="entry" id="user-pw-entry">
- <normal color="#000000" font="Sans 12"/>
- <pos anchor="nw" x="1" y="1" height="-2" width="-2"/>
- </item>
- </fixed>
- </item>
- <item type="button" id="ok_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="ok"/>
- </item>
- <item type="button" id="cancel_button">
- <pos anchor="n" x="50%" height="32" width="50%"/>
- <stock type="startagain"/>
- </item>
- <item type="label" id="pam-message">
- <pos anchor="n" x="50%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </box>
- <fixed>
- <item type="label" id="pam-error">
- <pos anchor="n" x="50%" y="110%"/>
- <normal color="#000000" font="Sans 12"/>
- <text></text>
- </item>
- </fixed>
- </item>
-</greeter>
-
-
diff --git a/gui/greeter/themes/happygnome/options.png b/gui/greeter/themes/happygnome/options.png
deleted file mode 100644
index 431813fa..00000000
--- a/gui/greeter/themes/happygnome/options.png
+++ /dev/null
Binary files differ
diff --git a/gui/greeter/themes/happygnome/screenshot.png b/gui/greeter/themes/happygnome/screenshot.png
deleted file mode 100644
index a31c9875..00000000
--- a/gui/greeter/themes/happygnome/screenshot.png
+++ /dev/null
Binary files differ
diff --git a/gui/login-photo.png b/gui/login-photo.png
deleted file mode 100644
index 0f2b5e03..00000000
--- a/gui/login-photo.png
+++ /dev/null
Binary files differ
diff --git a/gui/misc.c b/gui/misc.c
deleted file mode 100644
index 9ec09b23..00000000
--- a/gui/misc.c
+++ /dev/null
@@ -1,116 +0,0 @@
-/* GDM - The GNOME Display Manager - misc functions
- * Copyright (C) 1998, 1999, 2000 Martin K, Petersen <mkp@mkp.net>
- *
- * 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 "config.h"
-
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "misc.h"
-#include "gdmconfig.h"
-
-#define INDEX_FILE1 "index.theme"
-#define INDEX_FILE2 "index.theme.disabled"
-
-static char *
-gdm_get_font (const char *theme_name)
-{
- char *font_name;
- char *theme_dir;
- char *file_name;
- char buf[512];
- GtkStyle *style;
- FILE *fp;
-
- style = gtk_widget_get_default_style ();
- font_name = pango_font_description_to_string (style->font_desc);
-
- theme_dir = gtk_rc_get_theme_dir ();
- file_name = g_build_filename (theme_dir, theme_name, INDEX_FILE1, NULL);
- if ( ! g_file_test (file_name, G_FILE_TEST_EXISTS)) {
- g_free (file_name);
- file_name = g_build_filename (theme_dir, theme_name, INDEX_FILE2, NULL);
- if ( ! g_file_test (file_name, G_FILE_TEST_EXISTS)) {
- g_free (theme_dir);
- g_free (file_name);
- return font_name;
- }
- }
- g_free (theme_dir);
-
- /*
- * FIXME: this is evil!
- */
- fp = fopen (file_name, "r");
- if (fp != NULL) {
- while (fgets (buf, 512, fp) != NULL) {
- if (strncmp ("ApplicationFont", buf, 15) == 0) {
- char *tmp_name;
- tmp_name = strchr (buf, '=');
-
- if (tmp_name != NULL) {
- g_free (font_name);
- font_name = strdup (tmp_name + 1);
- }
-
- fclose (fp);
- g_free (file_name);
- return font_name;
- }
- }
- fclose (fp);
- }
- g_free (file_name);
- return font_name;
-}
-
-/* perhaps needs to do something like:
- login_window_resize (FALSE);
- gdm_wm_center_window (GTK_WINDOW (login));
- after calling if doing during runtime
- */
-void
-gdm_set_theme (const char *theme_name)
-{
- char *font_name;
- GtkSettings *settings = gtk_settings_get_default ();
-
- font_name = gdm_get_font (theme_name);
-
- gtk_settings_set_string_property (settings,
- "gtk-theme-name", theme_name, "gdm");
- gtk_settings_set_string_property (settings,
- "gtk-font-name", font_name, "gdm");
- g_free (font_name);
-}
-
-gboolean
-gdm_working_command_exists (const char *commands)
-{
- char *command = ve_get_first_working_command
- (commands, TRUE /* only_existance */);
- if (command == NULL)
- return FALSE;
- g_free (command);
- return TRUE;
-}
-
-
-/* EOF */
diff --git a/gui/misc.h b/gui/misc.h
deleted file mode 100644
index ba352841..00000000
--- a/gui/misc.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* GDM - The Gnome Display Manager - misc functions
- * Copyright (C) 1998, 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * 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 MISC_H
-#define MISC_H
-
-void gdm_set_theme (const char *theme_name);
-gboolean gdm_working_command_exists (const char *commands);
-
-#endif /* MISC_H */
-
-/* EOF */
diff --git a/gui/modules/.cvsignore b/gui/modules/.cvsignore
deleted file mode 100644
index a843dfe9..00000000
--- a/gui/modules/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-Makefile
-Makefile.in
-.deps
-.libs
-AccessDwellMouseEvents
-AccessKeyMouseEvents
diff --git a/gui/modules/AccessDwellMouseEvents.in b/gui/modules/AccessDwellMouseEvents.in
deleted file mode 100644
index d04c25a9..00000000
--- a/gui/modules/AccessDwellMouseEvents.in
+++ /dev/null
@@ -1,59 +0,0 @@
-# This is the configuration file for the keymouselistener.so module.
-# The confiuration syntax is as follows:
-#
-# crossing inital_direction timeout executable_path +args
-#
-# For executable_path give the full executable path path of the program or the
-# DefaultPath is used.
-#
-# where:
-#
-# + crossing is a string that includes any combination of TBLR characters, where
-# T means Top, B means Bottom, L means Left, and R means Right.
-#
-# + initial_direction can be either the I or O character which indicates
-# that the initial crossing is a motion In or Out of the window.
-#
-# e.g.
-# TBLR I 10000 @AT_BINDIR@/gok --login --access-method=dwellselection
-#
-# Means the user crosses into the top border, out the bottom border, into the left
-# border, and then out the right border (in that order). The initial_direction
-# value of I is what specifies that the first crossing is into the top border
-# rather than out of the top border. Each border crossing must occur within
-# 10000ms of the last border crossing for the gesture to be valid.
-#
-# It is possible to invoke multiple actions from a single gesture using the <Add>
-# keyword. Action specified with <Add> are invoked by the previous gesture
-# defined in the file. If the <Add> action is the first action defined in the
-# file, then it is ignored.
-#
-# e.g.
-#
-# <Add> @AT_BINDIR@/orca -n -d main-window
-#
-
-# GNOME On-Screen Keyboard - support several different options for different
-# user needs. Note these gestures all start by moving the mouse into the top
-# window border.
-#
-TBLR I 10000 @AT_BINDIR@/gok --login --access-method=dwellselection
-TLBR I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch1 --select-action=switch1
-TRBL I 10000 @AT_BINDIR@/gok --login --access-method=inversescanning --scan-action=switch1 --select-action=switch2
-TBRL I 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch3 --select-action=switch3
-
-# Orca. Note these gestures all start by moving the mouse into the
-# bottom window border.
-#
-# Speech
-#
-BTRL I 10000 @AT_BINDIR@/orca -n -d main-window
-
-# Magnifier
-#
-BTLR I 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier
-
-# Speech and Magnifier
-#
-BRTL I 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
-
diff --git a/gui/modules/AccessKeyMouseEvents.in b/gui/modules/AccessKeyMouseEvents.in
deleted file mode 100644
index 5b862f3e..00000000
--- a/gui/modules/AccessKeyMouseEvents.in
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is the configuration file for the keymouselistener.so module.
-# The confiuration syntax is as follows:
-#
-# For keyboard gestures:
-#
-# <modifier>[<modifier>...]key #times duration timeout executable_path +args
-#
-# For executable_path give the full executable path path of the program or the
-# DefaultPath is used. For key, this can be one of the normal keys such as 'k'
-# for the letter 'k', or 'F10' for the F10 key. If you wish to use one of the
-# 'modifier' keys you have to specify which one exactly, meaning usually
-# appending _L or _R depending on if it's the left or right one. The useful
-# ones are: Shift_L, Shift_R, Control_L, Control_R, Meta_L, Meta_R, Alt_L, Alt_R.
-# Do note that the modifier is optional.
-#
-# e.g.
-#
-# <Control>k 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-#
-# Means press Contol-k 5 times, holding each keypress down for at least 1000ms
-# (1s) each time and with no greater interval than 10000ms (10s) between each
-# event in the sequence. A duration value of 0 indicates that a keypress of
-# any length is accepted. The timeout value is only meaningful if the #times
-# value is > 1. Completing the above example sequence will invoke the gnome on
-# screen keyboard program, gok. Note that you cannot release the <Control> key
-# while pressing otherwise the sequence will be lost.
-#
-# e.g.
-# Shift_L 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-# Shift_R 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-#
-# Will start gok if you press either shift key 5 times holding it down for more
-# then 1 second each time.
-#
-# For mouse button gestures the format is the same except the mouse button number
-# is specified instead of a key gesture:
-#
-# <Mouse#> #times duration timeout executable_path +args
-#
-# e.g.
-#
-# <Mouse2> 4 3000 6000 @AT_BINDIR@/orca -n -d main-window
-#
-# Note that mouse numbers are 1-based so <Mouse1> is the left mouse button,
-# <Mouse3> is the right mouse button and <Mouse2> is the middle mouse button.
-#
-# It is possible to invoke multiple actions from a single gesture using the <Add>
-# keyword. Actions specified with <Add> are invoked by the previous gesture
-# defined in the file. If the <Add> action is the first action defined in the
-# file, then it is ignored.
-#
-# e.g.
-#
-# <Add> @AT_BINDIR@/gnome-mag
-#
-
-# hold right or left mouse button 3 times for 3 seconds each time
-#
-<Mouse1> 3 3000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-
-# we add the right mouse button as it may be the left mouse button
-# for a left handed user
-#
-<Mouse3> 3 3000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-
-<Switch1> 1 5000 0 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch1 --select-action=switch1
-<Switch2> 3 50 3000 @AT_BINDIR@/gok --login --access-method=inversescanning --scan-action=switch1 --select-action=switch2
-<Switch3> 3 1000 10000 @AT_BINDIR@/gok --login --access-method=automaticscanning --scan-action=switch3 --select-action=switch3
-
-# press ctrl-s for 1 second to launch orca in speech mode
-#
-<Control>s 1 1000 10000 @AT_BINDIR@/orca -n -d main-window
-
-# press ctrl-m for 1 second to launch orca in mag mode
-#
-<Control>m 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -d speech -e magnifier
-
-# press ctrl-o or ctrl-g for 1 second to launch orca in speech and mag mode
-#
-<Control>o 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
-<Control>g 1 1000 10000 @AT_BINDIR@/orca -n -d main-window -e magnifier
-
-# Start GOK with direct selection mode.
-#
-<Control>k 5 1000 10000 @AT_BINDIR@/gok --login --access-method=directselection
-
diff --git a/gui/modules/Makefile.am b/gui/modules/Makefile.am
deleted file mode 100644
index 868d0db9..00000000
--- a/gui/modules/Makefile.am
+++ /dev/null
@@ -1,88 +0,0 @@
-## Process this file with automake to produce makefile.in
-
-INCLUDES = \
- -I. \
- -I.. \
- -DGDMCONFDIR=\"${gdmconfdir}\" \
- -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
- $(GUI_CFLAGS)
-
-#
-# -DG_DISABLE_DEPRECATED \
-# -DGDK_DISABLE_DEPRECATED \
-# -DGDK_PIXBUF_DISABLE_DEPRECATED \
-# -DGTK_DISABLE_DEPRECATED \
-# -DGNOME_DISABLE_DEPRECATED \
-#
-
-libkeymouselistener_la_SOURCES = \
- keymouselistener.c
-
-libkeymouselistener_la_LDFLAGS = \
- -rpath $(moduledir) -module -avoid-version \
- $(GUI_LIBS) \
- $(X_LIBS) \
- $(X_EXTRA_LIBS)
-
-libdwellmouselistener_la_SOURCES = \
- dwellmouselistener.c
-
-libdwellmouselistener_la_LDFLAGS = \
- -rpath $(moduledir) -module -avoid-version \
- $(GUI_LIBS) \
- $(X_LIBS) \
- $(X_EXTRA_LIBS)
-
-moduledir = $(libdir)/gtk-2.0/modules
-
-module_LTLIBRARIES = \
- libkeymouselistener.la \
- libdwellmouselistener.la
-
-moduleconfdir = $(gdmconfdir)/modules
-
-noinst_DATA = \
- AccessKeyMouseEvents \
- AccessDwellMouseEvents
-
-EXTRA_DIST = \
- AccessKeyMouseEvents.in \
- AccessDwellMouseEvents.in
-
-CLEANFILES = AccessKeyMouseEvents AccessDwellMouseEvents
-
-AccessKeyMouseEvents: $(srcdir)/AccessKeyMouseEvents.in
- sed -e 's,[@]AT_BINDIR[@],$(AT_BINDIR),g' \
- <$(srcdir)/AccessKeyMouseEvents.in >AccessKeyMouseEvents
-
-AccessDwellMouseEvents: $(srcdir)/AccessDwellMouseEvents.in
- sed -e 's,[@]AT_BINDIR[@],$(AT_BINDIR),g' \
- <$(srcdir)/AccessDwellMouseEvents.in >AccessDwellMouseEvents
-
-uninstall-hook:
- rm -f $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents \
- $(DESTDIR)$(moduleconfdir)/factory-AccessKeyMouseEvents \
- $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents \
- $(DESTDIR)$(moduleconfdir)/factory-AccessDwellMouseEvents
-
-install-data-hook: AccessKeyMouseEvents AccessDwellMouseEvents
- if test '!' -d $(DESTDIR)$(moduleconfdir); then \
- $(mkinstalldirs) $(DESTDIR)$(moduleconfdir); \
- chmod 755 $(DESTDIR)$(moduleconfdir); \
- fi
- -if cmp -s $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents $(DESTDIR)$(moduleconfdir)/factory-AccessKeyMouseEvents 2>&1 /dev/null ; then \
- cp -f $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents.orig; \
- $(INSTALL_DATA) AccessKeyMouseEvents $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents; \
- fi
- if test '!' -f $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents; then \
- $(INSTALL_DATA) AccessKeyMouseEvents $(DESTDIR)$(moduleconfdir)/AccessKeyMouseEvents; \
- fi
- $(INSTALL_DATA) AccessKeyMouseEvents $(DESTDIR)$(moduleconfdir)/factory-AccessKeyMouseEvents
- -if cmp -s $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents $(DESTDIR)$(moduleconfdir)/factory-AccessDwellMouseEvents 2>&1 /dev/null ; then \
- cp -f $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents.orig; \
- $(INSTALL_DATA) AccessDwellMouseEvents $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents; \
- fi
- if test '!' -f $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents; then \
- $(INSTALL_DATA) AccessDwellMouseEvents $(DESTDIR)$(moduleconfdir)/AccessDwellMouseEvents; \
- fi
- $(INSTALL_DATA) AccessDwellMouseEvents $(DESTDIR)$(moduleconfdir)/factory-AccessDwellMouseEvents
diff --git a/gui/modules/dwellmouselistener.c b/gui/modules/dwellmouselistener.c
deleted file mode 100644
index 419b30ae..00000000
--- a/gui/modules/dwellmouselistener.c
+++ /dev/null
@@ -1,760 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file 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
- */
-
-#include "config.h"
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <syslog.h>
-#include <math.h>
-
-#include <glib.h>
-#include <gmodule.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include <X11/Xlib.h>
-
-#ifdef HAVE_XINPUT
-#include <X11/extensions/XInput.h>
-#endif
-
-/*
- * Note that CONFIGFILE will have to be changed to something more generic
- * if this module is ever moved outside of gdm.
- */
-
-#define CONFIGFILE GDMCONFDIR "/modules/AccessDwellMouseEvents"
-#define iseol(ch) ((ch) == '\r' || (ch) == '\f' || (ch) == '\0' || \
- (ch) == '\n')
-
-typedef enum
-{
- BINDING_DWELL_BORDER_TOP = 1 << 0,
- BINDING_DWELL_BORDER_BOTTOM = 1 << 1,
- BINDING_DWELL_BORDER_RIGHT = 1 << 2,
- BINDING_DWELL_BORDER_LEFT = 1 << 3,
- BINDING_DWELL_BORDER_ERROR = 1 << 4
-} BindingType;
-
-typedef enum
-{
- BINDING_DWELL_DIRECTION_IN = 1 << 0,
- BINDING_DWELL_DIRECTION_OUT = 1 << 1,
- BINDING_DWELL_DIRECTION_ERROR = 1 << 2
-} BindingDirection;
-
-typedef struct {
- int num_gestures;
- BindingType *gesture;
- BindingDirection start_direction;
-} Dwell;
-
-typedef struct {
- Dwell input;
- char *binding_str;
- GSList *actions;
- guint timeout;
-} Binding;
-
-typedef struct {
- BindingType type;
- BindingDirection direction;
- guint32 time;
-} Crossings;
-
-static int lineno = 0;
-static GSList *binding_list = NULL;
-
-extern char **environ;
-
-static guint enter_signal_id = 0;
-static guint leave_signal_id = 0;
-static int xinput_type_motion = 0;
-
-static Crossings *crossings = NULL;
-static int cross_pos = 0;
-static guint max_crossings = 0;
-static XID *ext_input_devices = NULL;
-static gint ext_device_count = 0;
-static gboolean latch_core_pointer = TRUE;
-
-static void create_event_watcher (void);
-static void load_bindings(gchar *path);
-static gchar * screen_exec_display_string (GdkScreen *screen, const char *old);
-static gchar ** get_exec_environment (GdkScreen *screen);
-static Binding * parse_line(gchar *buf);
-static gboolean binding_already_used (Binding *binding);
-static gboolean debug_gestures = FALSE;
-
-BindingType get_binding_type(char c);
-BindingDirection get_binding_direction(char c);
-
-static gboolean
-is_ext_device (XID id)
-{
- gint i;
- for (i=0; i < ext_device_count; i++)
- if (id == ext_input_devices[i])
- return TRUE;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "is-ext-device failed for %d", (int) id);
-
- return FALSE;
-}
-
-static void
-init_xinput (GdkDisplay *display, GdkWindow *root)
-{
-#ifdef HAVE_XINPUT
- XEventClass event_list[40];
- int i, j, number = 0, num_devices;
- XDeviceInfo *devices = NULL;
- XDevice *device = NULL;
-
- devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display),
- &num_devices);
-
- if (debug_gestures)
- syslog (LOG_WARNING, "Checking %d input devices...",
- num_devices);
-
- for (i=0; i < num_devices; i++) {
- if (devices[i].use == IsXExtensionDevice) {
- device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
- devices[i].id);
- for (j=0; j < device->num_classes && number < 39; j++) {
- switch (device->classes[j].input_class)
- {
- case ValuatorClass:
- DeviceMotionNotify (device,
- xinput_type_motion,
- event_list[number]);
- number++;
- default:
- break;
- }
- }
- ++ext_device_count;
-
- if (ext_input_devices) {
- ext_input_devices = g_realloc (ext_input_devices,
- sizeof (XID *) * ext_device_count);
- } else {
- ext_input_devices = g_malloc (sizeof (XID *));
- }
- ext_input_devices[ext_device_count - 1] = devices[i].id;
- }
- }
-
- if (debug_gestures)
- syslog (LOG_WARNING, "%d event types available", number);
-
- if (XSelectExtensionEvent (GDK_WINDOW_XDISPLAY (root),
- GDK_WINDOW_XWINDOW (root),
- event_list, number)) {
- if (debug_gestures)
- syslog (LOG_WARNING,
- "Can't select input device events!");
- }
-#endif
-}
-
-static gchar *
-screen_exec_display_string (GdkScreen *screen, const char *old)
-{
- GString *str;
- const gchar *old_display;
- gchar *retval;
- gchar *p;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
- old_display = gdk_display_get_name (gdk_screen_get_display (screen));
-
- str = g_string_new ("DISPLAY=");
- g_string_append (str, old_display);
-
- p = strrchr (str->str, '.');
- if (p && p > strchr (str->str, ':'))
- g_string_truncate (str, p - str->str);
-
- g_string_append_printf (str, ".%d", gdk_screen_get_number (screen));
-
- retval = str->str;
-
- g_string_free (str, FALSE);
-
- return retval;
-}
-
-/**
- * get_exec_environment:
- *
- * Description: Modifies the current program environment to
- * ensure that $DISPLAY is set such that a launched application
- * inheriting this environment would appear on screen.
- *
- * Returns: a newly-allocated %NULL-terminated array of strings or
- * %NULL on error. Use g_strfreev() to free it.
- *
- * mainly ripped from egg_screen_exec_display_string in
- * gnome-panel/egg-screen-exec.c
- **/
-static gchar **
-get_exec_environment (GdkScreen *screen)
-{
- gchar **retval = NULL;
- gint i;
- gint display_index = -1;
-
- g_assert (GDK_IS_SCREEN (screen));
-
- for (i=0; environ [i]; i++)
- if (strncmp (environ [i], "DISPLAY", 7) == 0)
- display_index = i;
-
- if (display_index == -1)
- display_index = i++;
-
- retval = g_new0 (char *, i + 1);
-
- for (i=0; environ [i]; i++)
- if (i == display_index)
- retval [i] = screen_exec_display_string (screen,
- environ[i]);
- else
- retval [i] = g_strdup (environ [i]);
-
- retval [i] = NULL;
-
- return retval;
-}
-
-BindingType
-get_binding_type(char c)
-{
- BindingType rc;
-
- if (c == toupper ('T'))
- rc = BINDING_DWELL_BORDER_TOP;
- else if (c == toupper ('B'))
- rc = BINDING_DWELL_BORDER_BOTTOM;
- else if (c == toupper ('R'))
- rc = BINDING_DWELL_BORDER_RIGHT;
- else if (c == toupper ('L'))
- rc = BINDING_DWELL_BORDER_LEFT;
- else
- rc = BINDING_DWELL_BORDER_ERROR;
-
- return rc;
-}
-
-BindingDirection
-get_binding_direction(char c)
-{
- BindingDirection rc;
-
- if (c == toupper ('I'))
- rc = BINDING_DWELL_DIRECTION_IN;
- else if (c == toupper ('O'))
- rc = BINDING_DWELL_DIRECTION_OUT;
- else
- rc = BINDING_DWELL_DIRECTION_ERROR;
-
- return rc;
-}
-
-static void
-free_binding (Binding *binding)
-{
- if (binding == NULL)
- return;
-
- g_slist_foreach (binding->actions, (GFunc)g_free, NULL);
- g_slist_free (binding->actions);
- g_free (binding->binding_str);
- g_free (binding->input.gesture);
- g_free (binding);
-}
-
-static Binding *
-parse_line(gchar *buf)
-{
- gchar *keystring, *keyservice;
- Binding *tmp_binding = NULL;
- static GdkDisplay *display = NULL;
-
- lineno++;
-
- if (!display) {
- if ((display = gdk_display_get_default ()) == NULL)
- return NULL;
- }
-
- if ((*buf == '#') || (iseol (*buf)) || (buf == NULL))
- return NULL;
-
- /* Find the binding name */
- keystring = strtok (buf, " \t\n\r\f");
- if (keystring == NULL) {
- /* TODO - Add an error message */
- return NULL;
- }
-
- tmp_binding = g_new0 (Binding, 1);
- tmp_binding->binding_str = g_strdup (keystring);
-
- if (strcmp (tmp_binding->binding_str, "<Add>") != 0) {
- BindingType bt;
- BindingDirection bd;
- guint timeout;
- gchar *tmp_string;
- int i, j;
-
- tmp_binding->input.gesture = g_new0 (BindingType,
- strlen (tmp_binding->binding_str));
-
- j=0;
- for (i=0; i < strlen(tmp_binding->binding_str); i++) {
- bt = get_binding_type (tmp_binding->binding_str[i]);
-
- if (bt == BINDING_DWELL_BORDER_ERROR) {
- if (debug_gestures)
- syslog (LOG_WARNING,
- "Invalid value in binding %s",
- tmp_binding->binding_str);
-
- continue;
- }
-
- tmp_binding->input.gesture[j++] = bt;
- }
- tmp_binding->input.num_gestures = j;
-
- if (j > max_crossings)
- max_crossings = j;
-
- /* [TODO] Need to clean up here. */
- tmp_string = strtok (NULL, " \t\n\r\f");
- if (tmp_string == NULL) {
- /* TODO - Add an error message */
- free_binding (tmp_binding);
- return NULL;
- }
-
- bd = get_binding_direction (tmp_string[0]);
-
- if (bd == BINDING_DWELL_DIRECTION_ERROR) {
- if (debug_gestures)
- syslog (LOG_WARNING, "Invalid value in binding %s",
- tmp_binding->binding_str);
- } else {
- tmp_binding->input.start_direction = bd;
- }
-
- /*
- * Find the timeout duration (in ms). Timeout value is the
- * time within which consecutive keypress actions must be
- * performed by the user before the sequence is discarded.
- */
-
- tmp_string = strtok (NULL, " \t\n\r\f");
- if (tmp_string == NULL) {
- /* TODO - Add an error message */
- free_binding (tmp_binding);
- return NULL;
- }
-
- timeout = atoi (tmp_string);
- if (timeout <= 0) {
- /* TODO - Add an error message */;
- free_binding (tmp_binding);
- return NULL;
- }
- tmp_binding->timeout = timeout;
- }
-
- /* Find service. Permit blank space so arguments can be supplied. */
- keyservice = strtok (NULL, "\n\r\f");
- if (keyservice == NULL) {
- /* TODO - Add an error message */
- free_binding (tmp_binding);
- return NULL;
- }
-
- /* skip over initial whitespace */
- while (*keyservice && isspace (*keyservice))
- keyservice++;
-
- tmp_binding->actions = g_slist_append (tmp_binding->actions,
- g_strdup (keyservice));
-
- return tmp_binding;
-}
-
-static gboolean
-binding_already_used (Binding *binding)
-{
- GSList *li;
-
- for (li=binding_list; li != NULL; li = li->next) {
- Binding *tmp_binding = (Binding*) li->data;
-
- if (tmp_binding != binding &&
- tmp_binding->input.start_direction == binding->input.start_direction)
- {
- int i;
-
- for (i=0; i < tmp_binding->input.num_gestures; i++) {
- if (tmp_binding->input.gesture !=
- binding->input.gesture)
- break;
- }
-
- if (i == tmp_binding->input.num_gestures)
- return TRUE;
- }
- }
- return FALSE;
-}
-
-static void
-load_bindings(gchar *path)
-{
- FILE *fp;
- Binding *tmp_binding;
- gchar buf[1024];
-
- fp = fopen (path, "r");
- if (fp == NULL) {
- /* TODO - I18n */
- if (debug_gestures)
- syslog (LOG_WARNING,
- "Cannot open bindings file: %s", path);
- return;
- }
-
- while (fgets (buf, sizeof (buf), fp) != NULL) {
- tmp_binding = (Binding *)parse_line (buf);
-
- if (tmp_binding) {
- /* Is the key already associated with an existing */
- /* binding? */
- if (strcmp (tmp_binding->binding_str, "<Add>") == 0) {
- /* Add another action to the last binding */
- Binding *last_binding;
- GSList *last_item = g_slist_last (binding_list);
-
- /* If there is no last_item to add onto */
- /* ignore the entry */
- if (last_item) {
- last_binding = (Binding *)last_item->data;
-
- /* Add the action to the last */
- /* binding's actions list */
- last_binding->actions =
- g_slist_append (last_binding->actions,
- g_strdup ((gchar *)tmp_binding->actions->data));
- }
- free_binding (tmp_binding);
-
- /* Ignore duplicate bindings */
- } else if (!binding_already_used (tmp_binding))
- binding_list = g_slist_append (binding_list,
- tmp_binding);
- else
- free_binding (tmp_binding);
- }
- }
- fclose (fp);
-}
-
-static gboolean
-change_cursor_back (gpointer data)
-{
- GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR);
- gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
- gdk_cursor_unref (cursor);
-
- return FALSE;
-}
-
-
-static gboolean
-leave_enter_emission_hook (GSignalInvocationHint *ihint,
- guint n_param_values,
- const GValue *param_values,
- gpointer data)
-{
- GObject *object;
- GtkWidget *widget;
- GtkWindow *window;
- GdkEventCrossing *event;
- GdkRectangle rect;
- GSList *li;
- double mid_x, mid_y;
- int i;
-
- object = g_value_get_object (param_values + 0);
- event = g_value_get_boxed (param_values + 1);
- widget = GTK_WIDGET (object);
- window = GTK_WINDOW (object);
-
- if (event->detail == GDK_NOTIFY_INFERIOR ||
- !GTK_IS_WINDOW (object) || !GTK_WIDGET_TOPLEVEL (object)) {
- return TRUE;
- }
-
- gdk_window_get_frame_extents (widget->window, &rect);
-
- mid_x = rect.x + (rect.width / 2);
- mid_y = rect.y + (rect.height / 2);
-
- /* avoid division by 0 */
- if (fabs (event->x_root - mid_x) <= 0.001) {
- if (event->x_root < mid_x)
- crossings[cross_pos].type = BINDING_DWELL_BORDER_LEFT;
- else
- crossings[cross_pos].type = BINDING_DWELL_BORDER_RIGHT;
- } else {
- double slope = (event->y_root - mid_y) / (event->x_root - mid_x);
-
- if (event->y_root < mid_y) {
- if (slope > 1 || slope < -1)
- crossings[cross_pos].type = BINDING_DWELL_BORDER_TOP;
- else if (slope >= 0)
- crossings[cross_pos].type = BINDING_DWELL_BORDER_LEFT;
- else
- crossings[cross_pos].type = BINDING_DWELL_BORDER_RIGHT;
- } else {
- if (slope > 1 || slope < -1)
- crossings[cross_pos].type = BINDING_DWELL_BORDER_BOTTOM;
- else if (slope >= 0)
- crossings[cross_pos].type = BINDING_DWELL_BORDER_RIGHT;
- else
- crossings[cross_pos].type = BINDING_DWELL_BORDER_LEFT;
- }
- }
-
- if (ihint->signal_id == enter_signal_id)
- crossings[cross_pos].direction = BINDING_DWELL_DIRECTION_IN;
- else if (ihint->signal_id == leave_signal_id)
- crossings[cross_pos].direction = BINDING_DWELL_DIRECTION_OUT;
-
- if (debug_gestures) {
- if (crossings[cross_pos].type == BINDING_DWELL_BORDER_BOTTOM)
- syslog (LOG_WARNING, "Crossing bottom.");
- else if (crossings[cross_pos].type == BINDING_DWELL_BORDER_TOP)
- syslog (LOG_WARNING, "Crossing top.");
- else if (crossings[cross_pos].type == BINDING_DWELL_BORDER_LEFT)
- syslog (LOG_WARNING, "Crossing left.");
- else if (crossings[cross_pos].type == BINDING_DWELL_BORDER_RIGHT)
- syslog (LOG_WARNING, "Crossing right.");
-
- if (crossings[cross_pos].direction == BINDING_DWELL_DIRECTION_IN)
- syslog (LOG_WARNING, "Crossing in.");
- else if (crossings[cross_pos].direction == BINDING_DWELL_DIRECTION_OUT)
- syslog (LOG_WARNING, "Crossing out.");
- }
-
- crossings[cross_pos].time = event->time;
-
- /* Check to see if a gesture has been completed */
- for (li=binding_list; li != NULL; li = li->next) {
- Binding *curr_binding = (Binding *) li->data;
- GSList *act_li;
- gboolean retval;
- gchar **argv = NULL;
- gchar **envp = NULL;
- int start_pos = (cross_pos - curr_binding->input.num_gestures + 1 +
- max_crossings) % max_crossings;
-
- if (debug_gestures) {
- syslog (LOG_WARNING, "Checking against registered gestures");
- }
-
- /* being anal here */
- if (start_pos < 0)
- start_pos = 0;
-
- /* check direction */
- if (curr_binding->input.start_direction != crossings[start_pos].direction)
- continue;
-
- /* check borders */
- for (i=0; i < curr_binding->input.num_gestures; i++) {
- if (curr_binding->input.gesture[i] !=
- crossings[(start_pos + i) % max_crossings].type)
- break;
- }
-
- if (i != curr_binding->input.num_gestures)
- continue;
-
- /* check timeout values */
- for (i=1; i < curr_binding->input.num_gestures; i++) {
- int cur_pos = (start_pos + i) % max_crossings;
- int prev_pos = (start_pos + i - 1) % max_crossings;
- guint32 diff_time = crossings[cur_pos].time -
- crossings[prev_pos].time;
-
- if (curr_binding->timeout != 0 &&
- curr_binding->timeout < diff_time)
- break;
- }
-
- if (i != curr_binding->input.num_gestures)
- continue;
-
- /* gesture recognized */
- if (debug_gestures) {
- syslog (LOG_WARNING, "Found gesture");
- }
-
- for (act_li=curr_binding->actions; act_li != NULL; act_li=act_li->next) {
- gchar *action = (gchar *)act_li->data;
-
- g_return_val_if_fail (action != NULL, TRUE);
-
- if (!g_shell_parse_argv (action, NULL, &argv, NULL))
- continue;
-
- envp = get_exec_environment (gtk_window_get_screen(window));
-
- if (debug_gestures)
- syslog (LOG_WARNING, "Action is %s", action);
-
- retval = g_spawn_async (NULL, argv, envp,
- G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
-
- g_strfreev (argv);
- g_strfreev (envp);
-
- if ( ! retval) {
- GtkWidget *dialog = gtk_message_dialog_new (NULL,
- 0, GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error while trying to run (%s)\n"\
- "which is linked to (%s)"),
- action, curr_binding->binding_str);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog),
- FALSE);
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy), NULL);
- gtk_widget_show (dialog);
- } else {
- GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (gdk_get_default_root_window (),
- cursor);
- gdk_cursor_unref (cursor);
- g_timeout_add (2000, change_cursor_back, NULL);
- latch_core_pointer = FALSE;
- /* once we've recognized a gesture, we need to *
- * leave the pointer alone */
- }
- }
- }
-
- cross_pos = (cross_pos + 1) % max_crossings;
-
- return TRUE;
-}
-
-static GdkFilterReturn
-gestures_filter (GdkXEvent *gdk_xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xevent = (XEvent *)gdk_xevent;
-
- if (xevent->type == xinput_type_motion) {
- XDeviceMotionEvent *motion = (XDeviceMotionEvent *) xevent;
- if ((motion->axes_count < 2) || !is_ext_device (motion->deviceid))
- return GDK_FILTER_CONTINUE;
- if (latch_core_pointer)
- XWarpPointer (motion->display, None,
- motion->root,
- 0, 0, 0, 0, motion->axis_data[0], motion->axis_data[1]);
- }
- return GDK_FILTER_CONTINUE;
-}
-
-static void
-create_event_watcher (void)
-{
- GdkDisplay *display;
- gint i;
-
- display = gdk_display_get_default ();
- if (!display)
- return;
-
- load_bindings(CONFIGFILE);
-
- crossings = g_new0(Crossings, max_crossings);
-
- for (i=0; i < max_crossings; i++) {
- crossings[i].type = BINDING_DWELL_BORDER_ERROR;
- crossings[i].direction = BINDING_DWELL_DIRECTION_ERROR;
- crossings[i].time = 0;
- }
-
- init_xinput (display,
- gdk_screen_get_root_window (
- gdk_display_get_default_screen (display)));
-
- gdk_window_add_filter (NULL, gestures_filter, NULL);
-
- /* set up emission hook */
- gtk_type_class (GTK_TYPE_WIDGET);
- enter_signal_id = g_signal_lookup ("enter-notify-event", GTK_TYPE_WIDGET);
- leave_signal_id = g_signal_lookup ("leave-notify-event", GTK_TYPE_WIDGET);
-
- g_signal_add_emission_hook (enter_signal_id, 0,
- leave_enter_emission_hook, NULL, (GDestroyNotify) NULL);
- g_signal_add_emission_hook (leave_signal_id, 0,
- leave_enter_emission_hook, NULL, (GDestroyNotify) NULL);
-}
-
-/* The init function for this gtk module */
-G_MODULE_EXPORT void gtk_module_init (int *argc, char* argv[]);
-
-void gtk_module_init (int *argc, char* argv[])
-{
- if (g_getenv ("GDM_DEBUG_GESTURES") != NULL)
- debug_gestures = TRUE;
-
- if (debug_gestures) {
- /* If not running under GDM, then need to openlog ourselves */
- if (g_getenv ("RUNNING_UNDER_GDM") == NULL)
- openlog ("gesturelistener", LOG_PID, LOG_DAEMON);
-
- syslog (LOG_WARNING, "dwellmouselistener loaded.");
- }
-
- create_event_watcher ();
-}
-
-/* EOF */
diff --git a/gui/modules/keymouselistener.c b/gui/modules/keymouselistener.c
deleted file mode 100644
index 759034df..00000000
--- a/gui/modules/keymouselistener.c
+++ /dev/null
@@ -1,1010 +0,0 @@
-/* GDM - The Gnome Display Manager
- * Copyright (C) 1999, 2000 Martin K. Petersen <mkp@mkp.net>
- *
- * This file 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
- */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <string.h>
-#include <syslog.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/keysym.h>
-
-#include <glib.h>
-#include <gmodule.h>
-#include <gdk/gdk.h>
-#include <gdk/gdkx.h>
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#ifdef HAVE_XINPUT
-#include <X11/extensions/XInput.h>
-#endif
-
-/*
- * Note that CONFIGFILE will have to be moved to somewhere more generic
- * if this module is ever moved outside of gdm.
- */
-#define CONFIGFILE GDMCONFDIR "/modules/AccessKeyMouseEvents"
-#define iseol(ch) ((ch) == '\r' || (ch) == '\f' || (ch) == '\0' || \
- (ch) == '\n')
-
-#define N_INPUT_TYPES 40
-
-typedef enum
-{
- GESTURE_TYPE_KEY = 1 << 0,
- GESTURE_TYPE_MOUSE = 1 << 1,
- GESTURE_TYPE_BUTTON = 1 << 2
-} GestureType;
-
-typedef enum {
- XINPUT_TYPE_MOTION = 0,
- XINPUT_TYPE_BUTTON_PRESS = 1,
- XINPUT_TYPE_BUTTON_RELEASE = 2,
- XINPUT_TYPE_KEY_PRESS = 3,
- XINPUT_TYPE_KEY_RELEASE = 4
-} XInputEventType;
-
-typedef struct {
- guint keysym;
- GdkModifierType state;
- guint keycode;
-} Key;
-
-typedef struct {
- guint number;
- GdkModifierType state;
-} Button;
-
-union Input {
- Key key;
- Button button;
-};
-
-typedef struct {
- GestureType type;
- union Input input;
- char *gesture_str;
- GSList *actions;
- guint n_times;
- guint duration;
- guint timeout;
- gint start_time;
- gint seq_count;
-} Gesture;
-
-static int xinput_types[N_INPUT_TYPES];
-
-extern char **environ;
-
-static gboolean debug_gestures = FALSE;
-static GSList *gesture_list = NULL;
-static int lineno = 0;
-
-static gchar * screen_exec_display_string (GdkScreen *screen, const char *old);
-static void create_event_watcher (void);
-static void load_gestures(gchar *path);
-static gchar ** get_exec_environment (XEvent *xevent);
-static Gesture * parse_line(gchar *buf);
-static GdkFilterReturn gestures_filter (GdkXEvent *gdk_xevent, GdkEvent *event, gpointer data);
-static gint is_mouseX (const gchar *string);
-static gint is_switchX (const gchar *string);
-
-#define gesture_list_get_matches(a, b, c) (g_slist_find_custom (a, b, c))
-
-static void
-free_gesture (Gesture *gesture)
-{
- if (gesture == NULL)
- return;
-
- g_slist_foreach (gesture->actions, (GFunc)g_free, NULL);
- g_slist_free (gesture->actions);
- g_free (gesture->gesture_str);
- g_free (gesture);
-}
-
-static gchar *
-screen_exec_display_string (GdkScreen *screen, const char *old)
-{
- GString *str;
- const gchar *old_display;
- gchar *retval;
- gchar *p;
-
- g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
- old_display = gdk_display_get_name (gdk_screen_get_display (screen));
-
- str = g_string_new ("DISPLAY=");
- g_string_append (str, old_display);
-
- p = strrchr (str->str, '.');
- if (p && p > strchr (str->str, ':'))
- g_string_truncate (str, p - str->str);
-
- g_string_append_printf (str, ".%d", gdk_screen_get_number (screen));
-
- retval = str->str;
-
- g_string_free (str, FALSE);
-
- return retval;
-}
-
-static void
-init_xinput (GdkDisplay *display, GdkWindow *root)
-{
-#ifdef HAVE_XINPUT
- XEventClass event_list[40];
- int i, j, number = 0, num_devices;
- XDeviceInfo *devices = NULL;
- XDevice *device = NULL;
-
- devices = XListInputDevices (GDK_DISPLAY_XDISPLAY (display),
- &num_devices);
-
- if (debug_gestures)
- syslog (LOG_WARNING, "checking %d input devices...", num_devices);
-
- for (i=0; i < num_devices; i++) {
- if (devices[i].use == IsXExtensionDevice)
- {
- device = XOpenDevice (GDK_DISPLAY_XDISPLAY (display),
- devices[i].id);
-
- for (j=0; j < device->num_classes && number < 39; j++) {
-
- switch (device->classes[j].input_class)
- {
- case KeyClass:
- DeviceKeyPress (device,
- xinput_types[XINPUT_TYPE_KEY_PRESS],
- event_list[number]);
- number++;
- DeviceKeyRelease (device,
- xinput_types[XINPUT_TYPE_KEY_RELEASE],
- event_list[number]);
- number++;
- break;
- case ButtonClass:
- DeviceButtonPress (device,
- xinput_types[XINPUT_TYPE_BUTTON_PRESS],
- event_list[number]);
- number++;
- DeviceButtonRelease (device,
- xinput_types[XINPUT_TYPE_BUTTON_RELEASE],
- event_list[number]);
- number++;
- break;
- case ValuatorClass:
- DeviceMotionNotify (device,
- xinput_types[XINPUT_TYPE_MOTION],
- event_list[number]);
- number++;
- }
- }
- }
- }
-
- if (debug_gestures)
- syslog (LOG_WARNING, "%d event types available", number);
-
- if (XSelectExtensionEvent(GDK_WINDOW_XDISPLAY (root),
- GDK_WINDOW_XWINDOW (root),
- event_list, number)) {
- if (debug_gestures)
- syslog (LOG_WARNING,
- "Can't select input device events!");
- }
-#endif
-}
-
-static void create_event_watcher (void)
-{
- GdkDisplay *display;
-
- display = gdk_display_get_default();
- if (!display)
- return;
-
- load_gestures(CONFIGFILE);
-
- init_xinput (display, gdk_screen_get_root_window (
- gdk_display_get_default_screen (display)));
-
- gdk_window_add_filter (NULL, gestures_filter, NULL);
-
- return;
-}
-
-
-static void
-load_gestures(gchar *path)
-{
- FILE *fp;
- Gesture *tmp_gesture;
- gchar buf[1024];
-
- fp = fopen (path, "r");
- if (fp == NULL) {
- /* TODO - I18n */
- if (debug_gestures)
- syslog (LOG_WARNING, _("Cannot open gestures file: %s"),
- path);
- return;
- }
-
- while (fgets (buf, sizeof (buf), fp) != NULL) {
-
- tmp_gesture = (Gesture *)parse_line(buf);
- if (tmp_gesture) {
-
- /* Is the key already associated with an existing
- gesture? */
- if (strcmp (tmp_gesture->gesture_str, "<Add>") == 0) {
-
- /* Add another action to the last gesture */
- Gesture *last_gesture;
- GSList *last_item = g_slist_last (gesture_list);
-
- /* If there is no last_item to add onto ignore
- the entry */
- if (last_item) {
- last_gesture = (Gesture *)
- last_item->data;
-
- /* Add the action to the last gesture's
- actions list */
- last_gesture->actions =
- g_slist_append (last_gesture->actions,
- g_strdup ((gchar *)tmp_gesture->actions->data));
- }
- free_gesture (tmp_gesture);
-
- /* We must be able to deal with multiple
- unambiguous gestures attached to one
- switch/button */
- } else {
- gesture_list = g_slist_append (gesture_list,
- tmp_gesture);
- }
- }
- }
- fclose (fp);
-}
-
-
-/**
- * get_exec_environment:
- *
- * Description: Modifies the current program environment to
- * ensure that $DISPLAY is set such that a launched application
- * inheriting this environment would appear on screen.
- *
- * Returns: a newly-allocated %NULL-terminated array of strings or
- * %NULL on error. Use g_strfreev() to free it.
- *
- * mainly ripped from egg_screen_exec_display_string in
- * gnome-panel/egg-screen-exec.c
- **/
-static gchar **
-get_exec_environment (XEvent *xevent)
-{
- gchar **retval = NULL;
- gint i;
- gint display_index = -1;
-
- GdkScreen *screen = NULL;
- GdkWindow *window = gdk_xid_table_lookup (xevent->xkey.root);
-
- if (window)
- screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
-
- /* TODO: revisit this fallback, it's suspect since Xi events might not
- have xkey.root set */
-
- else
- screen = gdk_display_get_default_screen (gdk_display_get_default ());
-
- g_assert (GDK_IS_SCREEN (screen));
-
- for (i=0; environ [i]; i++)
- if (!strncmp (environ [i], "DISPLAY", 7))
- display_index = i;
-
- if (display_index == -1)
- display_index = i++;
-
- retval = g_new0 (char *, i + 1);
-
- for (i=0; environ [i]; i++) {
- if (i == display_index)
- retval [i] = screen_exec_display_string (screen,
- environ[i]);
- else
- retval [i] = g_strdup (environ [i]);
- }
-
- retval [i] = NULL;
-
- return retval;
-}
-
-static Gesture *
-parse_line (gchar *buf)
-{
- static GdkDisplay *display = NULL;
- Gesture *tmp_gesture = NULL;
- gchar *keystring;
- gchar *keyservice;
- gint button = 0;
-
- if (!display) {
- if ((display = gdk_display_get_default()) == NULL)
- return NULL;
- }
- lineno++;
-
- if ((*buf == '#') || (iseol(*buf)) || (buf == NULL))
- return NULL;
-
- /* Find the key name */
- keystring = strtok (buf, " \t\n\r\f");
- if (keystring == NULL) {
- /* TODO - Error messages */
- return NULL;
- }
-
- tmp_gesture = g_new0 (Gesture, 1);
- tmp_gesture->gesture_str = g_strdup (keystring);
-
- if (strcmp (tmp_gesture->gesture_str, "<Add>") != 0) {
- guint n, duration, timeout;
- gchar *tmp_string;
-
- tmp_gesture->start_time = 0;
- tmp_gesture->seq_count = 0;
-
- button = is_mouseX (tmp_gesture->gesture_str);
- if (button > 0) {
- tmp_gesture->type = GESTURE_TYPE_MOUSE;
- tmp_gesture->input.button.number = button;
- } else if ((button = is_switchX (tmp_gesture->gesture_str)) == TRUE) {
- tmp_gesture->type = GESTURE_TYPE_BUTTON;
- tmp_gesture->input.button.number = button;
- } else {
- tmp_gesture->type = GESTURE_TYPE_KEY;
- gtk_accelerator_parse (tmp_gesture->gesture_str,
- &(tmp_gesture->input.key.keysym),
- &(tmp_gesture->input.key.state));
- if (tmp_gesture->input.key.keysym == 0 &&
- tmp_gesture->input.key.state == 0) {
- /* TODO - Error messages here */
- free_gesture (tmp_gesture);
- return NULL;
- }
- tmp_gesture->input.key.keycode =
- XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (display),
- tmp_gesture->input.key.keysym);
- }
-
- if (tmp_gesture->type == 0) {
- /* TODO - Error messages here */
- free_gesture (tmp_gesture);
- return NULL;
- }
- /* [TODO] Need to clean up here. */
-
- /* Find the repetition number */
- tmp_string = strtok (NULL, " \t\n\r\f");
- if (tmp_string == NULL) {
- /* TODO - Error messages */
- free_gesture (tmp_gesture);
- return NULL;
- }
-
- /* TODO - the above doesn't check for the string to
- be all digits */
- if ((n=atoi (tmp_string)) <= 0) {
- /* Add an error message */
- free_gesture (tmp_gesture);
- return NULL;
- }
- tmp_gesture->n_times = n;
-
- /*
- * Find the key press duration (in ms)
- */
- tmp_string = strtok (NULL, " \t\n\r\f");
- if (tmp_string == NULL) {
- /* TODO - Error messages */
- free_gesture (tmp_gesture);
- return NULL;
- }
- /* TODO - the above doesn't check for the string to
- be all digits */
-
- duration = atoi (tmp_string);
- if (duration < 0) {
- /* Add an error message */
- free_gesture (tmp_gesture);
- return NULL;
- }
- tmp_gesture->duration = duration;
-
- /*
- * Find the timeout duration (in ms). Timeout value is the
- * time within which consecutive keypress actions must be
- * performed by the user before the sequence is discarded.
- */
- tmp_string = strtok (NULL, " \t\n\r\f");
- if (tmp_string == NULL) {
- /* TODO - Error messages */
- free_gesture (tmp_gesture);
- return NULL;
- }
-
- /*
- * A gesture with an n_times value greater than 1 and a
- * non-positive timeout can never be triggered, so do not
- * accept such gestures. The value of timeout is not used
- * if n_times is 1, so don't bother setting the timeout in
- * this case.
- */
- tmp_gesture->timeout = 0;
- if (tmp_gesture->n_times > 1) {
- if ((timeout=atoi (tmp_string)) <= 0) {
- /* Add an error message */;
- free_gesture (tmp_gesture);
- return NULL;
- }
- tmp_gesture->timeout = timeout;
- }
- }
-
- /*
- * Find service. Permit blank space so arguments can be supplied.
- */
- keyservice = strtok (NULL, "\n\r\f");
- if (keyservice == NULL) {
- /* TODO - Error messages */
- free_gesture (tmp_gesture);
- return NULL;
- }
- /* skip over initial whitespace */
- while (*keyservice && isspace (*keyservice))
- keyservice++;
-
- tmp_gesture->actions = g_slist_append(tmp_gesture->actions,
- g_strdup(keyservice));
-
- if (debug_gestures)
- syslog (LOG_WARNING, "gesture parsed for %s button %d",
- (tmp_gesture->type == GESTURE_TYPE_MOUSE) ? "mouse" :
- ((tmp_gesture->type == GESTURE_TYPE_BUTTON) ? "switch" :
- "key"), tmp_gesture->input.button.number);
-
- return tmp_gesture;
-}
-
-/*
- * These modifiers are ignored because they make no sense.
- * .eg <NumLock>x
- *
- * FIXME: [sadly, NumLock isn't always mapped to the same modifier, so the logic
- * below is faulty - bill]
- */
-#define IGNORED_MODS (GDK_LOCK_MASK | GDK_MOD2_MASK | GDK_MOD3_MASK)
-#define USED_MODS (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK | \
- GDK_MOD4_MASK | GDK_MOD5_MASK)
-
-static gboolean
-change_cursor_back (gpointer data)
-{
- GdkCursor *cursor = gdk_cursor_new (GDK_LEFT_PTR);
- gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
- gdk_cursor_unref (cursor);
-
- return FALSE;
-}
-
-static gint
-event_time (XEvent *ev)
-{
- if ((ev->type == KeyPress) ||
- (ev->type == KeyRelease))
- return ((XKeyEvent *) ev)->time;
- else if ((ev->type == ButtonPress) ||
- (ev->type == ButtonRelease))
- return ((XButtonEvent *) ev)->time;
- else if ((ev->type == xinput_types[XINPUT_TYPE_KEY_PRESS]) ||
- (ev->type == xinput_types[XINPUT_TYPE_KEY_RELEASE]))
- return ((XDeviceKeyEvent *) ev)->time;
- else if ((ev->type == xinput_types[XINPUT_TYPE_BUTTON_PRESS]) ||
- (ev->type == xinput_types[XINPUT_TYPE_BUTTON_RELEASE]))
- return ((XDeviceButtonEvent *) ev)->time;
- else
- return 0;
-}
-
-static gint
-elapsed_time (XEvent *ev1, XEvent *ev2)
-{
- return event_time (ev2) - event_time (ev1);
-}
-
-static gboolean
-keycodes_equal (XEvent *ev1, XEvent *ev2)
-{
- if (ev1->type == ev2->type)
- {
- if (ev1->type == KeyPress || ev1->type == KeyRelease)
- {
- return (((XKeyEvent *) ev1)->keycode == ((XKeyEvent *) ev2)->keycode);
- }
- else if (ev1->type == xinput_types[XINPUT_TYPE_KEY_PRESS] ||
- ev1->type == xinput_types[XINPUT_TYPE_KEY_RELEASE])
- {
- return (((XDeviceKeyEvent *) ev1)->keycode == ((XDeviceKeyEvent *) ev2)->keycode);
- }
- }
- return FALSE;
-}
-
-static gint
-key_gesture_compare_func (gconstpointer a, gconstpointer b)
-{
- const Gesture *gesture = a;
- const XEvent *xev = b;
-
- if (gesture->type == GESTURE_TYPE_KEY)
- {
- if (((xev->type == KeyPress) || (xev->type == KeyRelease)) &&
- (xev->xkey.keycode == gesture->input.key.keycode) &&
- ((xev->xkey.state & USED_MODS) == gesture->input.key.state))
- return 0;
- else if (((xev->type == xinput_types[XINPUT_TYPE_KEY_PRESS]) ||
- (xev->type == xinput_types[XINPUT_TYPE_KEY_RELEASE])) &&
- (xev->xkey.keycode == gesture->input.key.keycode) &&
- ((xev->xkey.state & USED_MODS) == gesture->input.key.state))
- return 0;
- else
- return 1;
- }
- else if ((gesture->type == GESTURE_TYPE_MOUSE) &&
- ((xev->type == ButtonPress) || (xev->type == ButtonRelease)) &&
- (xev->xbutton.button == gesture->input.button.number))
- return 0;
- else if ((gesture->type == GESTURE_TYPE_BUTTON) &&
- ((xev->type == xinput_types[XINPUT_TYPE_BUTTON_PRESS]) ||
- (xev->type == xinput_types[XINPUT_TYPE_BUTTON_RELEASE])) &&
- ((XDeviceButtonEvent *) xev)->button == gesture->input.button.number)
- return 0;
- else
- return 1;
-}
-
-#define event_is_gesture_type(xevent) (xevent->type == KeyPress ||\
- xevent->type == KeyRelease ||\
- xevent->type == ButtonPress ||\
- xevent->type == ButtonRelease ||\
- xevent->type == xinput_types[XINPUT_TYPE_KEY_PRESS] ||\
- xevent->type == xinput_types[XINPUT_TYPE_KEY_RELEASE] ||\
- xevent->type == xinput_types[XINPUT_TYPE_BUTTON_PRESS] ||\
- xevent->type == xinput_types[XINPUT_TYPE_BUTTON_RELEASE])
-
-static GdkFilterReturn
-gestures_filter (GdkXEvent *gdk_xevent,
- GdkEvent *event,
- gpointer data)
-{
- XEvent *xevent = (XEvent *)gdk_xevent;
- GSList *li, *act_li;
- Gesture *curr_gesture = NULL;
- XID xinput_device = None;
-
- static XEvent *last_event = NULL;
- static gint seq_count = 0;
-
- if (!event_is_gesture_type (xevent))
- return GDK_FILTER_CONTINUE;
-
- if (!last_event)
- last_event = g_new0(XEvent, 1);
-
- if ((xevent->type == KeyPress) ||
- (xevent->type == xinput_types[XINPUT_TYPE_KEY_PRESS]))
- {
-
- if (debug_gestures)
- syslog (LOG_WARNING, "key press");
-
- if (last_event->type == KeyPress &&
- last_event->xkey.keycode == xevent->xkey.keycode) {
- /* these come from auto key-repeat */
-
- if (debug_gestures)
- syslog (LOG_WARNING, "rejecting repeat");
-
- return GDK_FILTER_CONTINUE;
- }
-
- if (seq_count > 0 &&
- last_event->type != KeyRelease) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "last event wasn't a release, resetting seq");
- seq_count = 0;
- }
- else if (seq_count > 0 &&
- keycodes_equal (last_event, xevent)) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "keycode doesn't match last event, resetting seq");
- seq_count = 0;
- }
-
- /* Find the associated gesture for this keycode & state */
- li = gesture_list_get_matches (gesture_list, xevent,
- key_gesture_compare_func);
-
- if (li) {
- curr_gesture = li->data;
- if (debug_gestures)
- syslog (LOG_WARNING,
- "found a press match [%s]",
- curr_gesture->gesture_str);
-
- /* xevent time values are in milliseconds. */
- /* The config file spec is in ms */
- if (curr_gesture->timeout > 0 && seq_count > 0 &&
- elapsed_time (last_event, xevent) >
- curr_gesture->timeout) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "timeout exceeded: reset seq and gesture");
-
- /* The timeout has been exceeded.
- Reset the sequence. */
- seq_count = 0;
- curr_gesture = NULL;
- }
- }
- }
- else if ((xevent->type == KeyRelease) ||
- (xevent->type == xinput_types[XINPUT_TYPE_KEY_RELEASE]))
- {
- if (debug_gestures)
- syslog (LOG_WARNING, "key release");
-
- if (seq_count > 0 &&
- ((last_event->type != KeyPress &&
- last_event->type != xinput_types[XINPUT_TYPE_KEY_PRESS]) ||
- ! keycodes_equal (last_event, xevent))) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "either last event not a keypress, or keycodes don't match. Resetting seq.");
-
- seq_count = 0;
- }
-
- /*
- * Find the associated gesture for this keycode & state
- *
- * Note that here we check the state against the last_event,
- * otherwise key gestures based on modifier keys such as
- * Control_R won't work.
- */
- li = gesture_list_get_matches (gesture_list, xevent,
- key_gesture_compare_func);
-
- if (li) {
- curr_gesture = li->data;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "found a release match [%s]",
- curr_gesture->gesture_str);
-
- if ((curr_gesture->duration > 0) &&
- (elapsed_time (last_event, xevent) < curr_gesture->duration)) {
-
- seq_count = 0;
- curr_gesture = NULL;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "setting current gesture to NULL");
- } else {
- seq_count++;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "incrementing seq_count");
- }
- }
- }
- else if ((xevent->type == ButtonPress) ||
- (xevent->type == xinput_types[XINPUT_TYPE_BUTTON_PRESS])) {
- gint button = 0;
- gint time = 0;
-
- if (xevent->type == ButtonPress) {
- button = xevent->xbutton.button;
- time = xevent->xbutton.time;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "button press: %d", button);
-
- if (seq_count > 0 && (last_event->type != ButtonRelease))
- seq_count = 0;
- else if (seq_count > 0 && last_event->xbutton.button != button) {
- seq_count = 0;
- }
- }
-#ifdef HAVE_XINPUT
- else {
- button = ((XDeviceButtonEvent *) xevent)->button;
- time = ((XDeviceButtonEvent *) xevent)->time;
- if (debug_gestures)
- syslog (LOG_WARNING, "xinput button press: %d", button);
- if (seq_count > 0 &&
- last_event->type != xinput_types[XINPUT_TYPE_BUTTON_RELEASE]) {
- seq_count = 0;
- }
- else if (seq_count > 0 &&
- ((XDeviceButtonEvent *) last_event)->button != button) {
- seq_count = 0;
- }
- }
-#endif
-
- /*
- * Find the associated gesture for this button.
- */
- li = gesture_list_get_matches (gesture_list, xevent,
- key_gesture_compare_func);
- if (li) {
- if (debug_gestures)
- syslog (LOG_WARNING, "found match for press");
-
- curr_gesture = li->data;
-
- if (curr_gesture->timeout > 0 && seq_count > 0) {
-
- /* xevent time values are in milliseconds. */
- /* The config file spec is in ms */
- if (elapsed_time (last_event, xevent) > curr_gesture->timeout) {
-
- /* Timeout has elapsed. Reset the sequence. */
- seq_count = 0;
- curr_gesture = NULL;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "gesture timed out.");
- }
- }
- }
- else if (debug_gestures)
- syslog (LOG_WARNING, "no match for press %d", button);
- }
- else if ((xevent->type == ButtonRelease) ||
- (xevent->type == xinput_types[XINPUT_TYPE_BUTTON_RELEASE]))
- {
- gint button = 0;
- gint time = 0;
-
- if (xevent->type == ButtonRelease)
- {
- button = xevent->xbutton.button;
- time = xevent->xbutton.time;
- if (seq_count > 0 &&
- (last_event->type != ButtonPress ||
- last_event->xbutton.button != button)) {
- if (debug_gestures)
- syslog (LOG_WARNING,
- "resetting count to zero, based on failure to match last event.");
- seq_count = 0;
- }
- }
-#ifdef HAVE_XINPUT
- else
- {
- button = ((XDeviceButtonEvent *)(xevent))->button;
- time = ((XDeviceButtonEvent *)(xevent))->time;
- xinput_device = ((XDeviceButtonEvent *)(xevent))->deviceid;
-
- if (seq_count > 0 &&
- (last_event->type != xinput_types[XINPUT_TYPE_BUTTON_PRESS] ||
- ((XDeviceButtonEvent *) last_event)->button != button)) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "resetting count to zero, based on failure to match last input event.");
-
- seq_count = 0;
- }
- }
-#endif
-
- li = gesture_list_get_matches (gesture_list, xevent,
- key_gesture_compare_func);
-
- if (li) {
- if (debug_gestures)
- syslog (LOG_WARNING, "found match for release");
- curr_gesture = li->data;
- if ((curr_gesture->duration > 0) &&
- (elapsed_time (last_event, xevent) < curr_gesture->duration)) {
- seq_count = 0;
- curr_gesture = NULL;
- if (debug_gestures)
- syslog (LOG_WARNING, "insufficient duration.");
- } else {
- if (debug_gestures)
- syslog (LOG_WARNING, "duration OK");
- seq_count++;
- }
- }
- else if (debug_gestures)
- syslog (LOG_WARNING, "no match for release - button %d",
- button);
- }
-
- /*
- * Did this event complete any gesture sequences?
- */
- last_event = memcpy (last_event, xevent, sizeof(XEvent));
- if (curr_gesture) {
- if (seq_count != curr_gesture->n_times) {
-
- if (debug_gestures)
- syslog (LOG_WARNING,
- "waiting for %d more repetitions...",
- curr_gesture->n_times - seq_count);
-
- return GDK_FILTER_CONTINUE;
- } else {
- gboolean retval;
- gchar **argv = NULL;
- gchar **envp = NULL;
-
- if (debug_gestures)
- syslog (LOG_WARNING, "gesture complete!");
-
- seq_count = 0;
- for (act_li = curr_gesture->actions;
- act_li != NULL; act_li = act_li->next) {
-
- gchar *action = (gchar *)act_li->data;
- g_return_val_if_fail (action != NULL, GDK_FILTER_CONTINUE);
- if (!g_shell_parse_argv (action, NULL, &argv, NULL))
- continue;
-
- envp = get_exec_environment (xevent);
-
- if (debug_gestures)
- syslog (LOG_WARNING, "Action is %s", action);
-
- retval = g_spawn_async (NULL,
- argv,
- envp,
- G_SPAWN_SEARCH_PATH,
- NULL,
- NULL,
- NULL,
- NULL);
-
- g_strfreev (argv);
- g_strfreev (envp);
-
- if ( ! retval) {
- GtkWidget *dialog =
- gtk_message_dialog_new (NULL, 0,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_OK,
- _("Error while trying to run (%s)\n"\
- "which is linked to (%s)"),
- action,
- curr_gesture->gesture_str);
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog),
- FALSE);
- g_signal_connect (dialog, "response",
- G_CALLBACK (gtk_widget_destroy),
- NULL);
- gtk_widget_show (dialog);
- } else {
- GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
- gdk_window_set_cursor (gdk_get_default_root_window (),
- cursor);
- gdk_cursor_unref (cursor);
- g_timeout_add (2000,
- change_cursor_back,
- NULL);
- }
- }
- return GDK_FILTER_CONTINUE;
- }
- }
- return GDK_FILTER_CONTINUE;
-}
-
-
-static gint
-is_mouseX (const gchar *string)
-{
- if ((string[0] == '<') &&
- (string[1] == 'm' || string[1] == 'M') &&
- (string[2] == 'o' || string[2] == 'O') &&
- (string[3] == 'u' || string[3] == 'U') &&
- (string[4] == 's' || string[4] == 'S') &&
- (string[5] == 'e' || string[5] == 'E') &&
- (isdigit(string[6]) &&
- (atoi(&string[6]) > 0) &&
- (atoi(&string[6]) < 6)) &&
- (string[7] == '>'))
- return atoi(&string[6]);
- else
- return 0;
-}
-
-static gint
-is_switchX (const gchar *string)
-{
- if ((string[0] == '<') &&
- (string[1] == 's' || string[1] == 'S') &&
- (string[2] == 'w' || string[2] == 'W') &&
- (string[3] == 'i' || string[3] == 'I') &&
- (string[4] == 't' || string[4] == 'T') &&
- (string[5] == 'c' || string[5] == 'C') &&
- (string[6] == 'h' || string[6] == 'H') &&
- (isdigit(string[7]) &&
- (atoi(&string[7]) > 0) &&
- (atoi(&string[7]) < 6)) &&
- (string[8] == '>'))
- return atoi(&string[7]);
- else
- return 0;
-}
-
-/* The init function for this gtk module */
-G_MODULE_EXPORT void gtk_module_init(int *argc, char* argv[]);
-
-void gtk_module_init(int *argc, char* argv[])
-{
- if (g_getenv ("GDM_DEBUG_GESTURES") != NULL)
- debug_gestures = TRUE;
-
- if (debug_gestures) {
- /* If not running under GDM, then need to openlog ourselves */
- if (g_getenv ("RUNNING_UNDER_GDM") == NULL)
- openlog ("gesturelistener", LOG_PID, LOG_DAEMON);
-
- syslog (LOG_WARNING, "keymouselistener loaded.");
- }
-
- create_event_watcher ();
-}