summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2002-07-30 00:37:34 +0000
committerGeorge Lebl <jirka@src.gnome.org>2002-07-30 00:37:34 +0000
commit7a7978e4760f19a36ad38f720dfbaaa17e2916f0 (patch)
tree895a4ec77ac4151f5cb45a8e75704e04bac323cc /gui
parent4aeaa954623897884e1a81dbcf140f97b407b88b (diff)
downloadgdm-7a7978e4760f19a36ad38f720dfbaaa17e2916f0.tar.gz
use the ve_signal routines, remove gdm_signal routines
Mon Jul 29 17:45:59 2002 George Lebl <jirka@5z.com> * daemon/gdm.[ch]: use the ve_signal routines, remove gdm_signal routines * gui/gdmlogin.c, gui/greeter/greeter.c, gui/greeter/greeter_item_clock.[ch]: use the ve_signal routines for the HUP signal to avoid possible crashes/races/hangs if the signal handler comes in a bad time. Also don't reset the graphical on every damn change, just the ones we care about, and update clock on the fly instead of restarting. * gui/gdmchooser.c: make glade_helper not use the gnome_program thingie, since we never init it here. * gui/Makefile.am, gui/gdmlogin.c, gui/gdmchooser.c, gui/gdmflexiserver.c, gui/gdmXnestchooser.c, gui/gdmcomm.c gui/greeter/Makefile.am, gui/greeter/greeter.c, gui/greeter/greeter_item_pam.c, gui/greeter/greeter_item_clock.c, gui/greeter/greeter_item_capslock.c, gui/greeter/greeter_item.c, gui/greeter/greeter_canvas_item.c: Compile without deprecated stuff. fix minor bugs found during the process. Also compile everything with warnings and fix those. * gui/gdmlogin.c, gui/gdmcomm.c, gui/gdmsetup.c, gui/greeter/greeter.c: Use the new ve-config routines rather then gnome_config. Fixed config bugs found in the process. This also makes gdmsetup not delete comments and empty lines from the config which makes debugging and hand editting SO MUCH SIMPLER! * gui/gdmsetup.c: recheck for gdm running before every update * gui/gdmlogin.c, gui/greeter/greeter.c: remove the g_io_channel_init call which was reseting the whole setup. So our channels were still buffered and encoded, which manifested itself when the read calls were replaced the read_chars. This could actually solve the FreeBSD issues too.
Diffstat (limited to 'gui')
-rw-r--r--gui/Makefile.am5
-rw-r--r--gui/gdmXnestchooser.c23
-rw-r--r--gui/gdmchooser.c30
-rw-r--r--gui/gdmcomm.c36
-rw-r--r--gui/gdmflexiserver.c87
-rw-r--r--gui/gdmlogin.c282
-rw-r--r--gui/gdmphotosetup.c5
-rw-r--r--gui/gdmsetup.c278
-rw-r--r--gui/greeter/Makefile.am12
-rw-r--r--gui/greeter/greeter.c268
-rw-r--r--gui/greeter/greeter_canvas_item.c6
-rw-r--r--gui/greeter/greeter_item.c3
-rw-r--r--gui/greeter/greeter_item_capslock.c4
-rw-r--r--gui/greeter/greeter_item_clock.c15
-rw-r--r--gui/greeter/greeter_item_clock.h1
-rw-r--r--gui/greeter/greeter_item_pam.c1
16 files changed, 588 insertions, 468 deletions
diff --git a/gui/Makefile.am b/gui/Makefile.am
index acc5f247..28473073 100644
--- a/gui/Makefile.am
+++ b/gui/Makefile.am
@@ -13,6 +13,11 @@ DEFS = @DEFS@ -DGDM_CONFIG_FILE=\"@sysconfdir@/gdm/gdm.conf\" \
INCLUDES = \
-I. \
-I.. \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED \
+ -DGNOME_DISABLE_DEPRECATED \
-I$(top_srcdir)/daemon \
-I$(top_srcdir)/vicious-extensions \
-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
diff --git a/gui/gdmXnestchooser.c b/gui/gdmXnestchooser.c
index a2712db9..9125447f 100644
--- a/gui/gdmXnestchooser.c
+++ b/gui/gdmXnestchooser.c
@@ -362,14 +362,27 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
if (strcmp (base (argv[0]), "gdmXnest") == 0) {
- gnome_init_with_popt_table ("gdmXnest", VERSION,
- argc, argv, xnest_only_options,
- 0, &ctx);
+ GnomeProgram *program = gnome_program_init
+ ("gdmXnest", VERSION,
+ LIBGNOMEUI_MODULE /* module_info */,
+ argc, argv,
+ GNOME_PARAM_POPT_TABLE, xnest_only_options,
+ NULL);
+ g_object_get (G_OBJECT (program),
+ GNOME_PARAM_POPT_CONTEXT, &ctx,
+ NULL);
no_query = TRUE;
no_gdm_check = TRUE;
} else {
- gnome_init_with_popt_table ("gdmXnestchooser", VERSION,
- argc, argv, options, 0, &ctx);
+ GnomeProgram *program = gnome_program_init
+ ("gdmXnestchooser", VERSION,
+ LIBGNOMEUI_MODULE /* module_info */,
+ argc, argv,
+ GNOME_PARAM_POPT_TABLE, options,
+ NULL);
+ g_object_get (G_OBJECT (program),
+ GNOME_PARAM_POPT_CONTEXT, &ctx,
+ NULL);
}
args = poptGetArgs (ctx);
diff --git a/gui/gdmchooser.c b/gui/gdmchooser.c
index d993d1ab..1aabb446 100644
--- a/gui/gdmchooser.c
+++ b/gui/gdmchooser.c
@@ -156,8 +156,8 @@ static void
setup_cursor (GdkCursorType type)
{
GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (GDK_ROOT_PARENT (), cursor);
- gdk_cursor_destroy (cursor);
+ gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
+ gdk_cursor_unref (cursor);
}
static void
@@ -167,7 +167,7 @@ gdm_chooser_host_dispose (GdmChooserHost *host)
return;
if (host->picture != NULL)
- gdk_pixbuf_unref (host->picture);
+ g_object_unref (G_OBJECT (host->picture));
host->picture = NULL;
g_free (host->name);
@@ -246,11 +246,11 @@ gdm_chooser_host_alloc (const char *hostname,
host->picture = gdk_pixbuf_scale_simple (img, w, h,
GDK_INTERP_BILINEAR);
else
- host->picture = gdk_pixbuf_ref (img);
+ host->picture = g_object_ref (G_OBJECT (img));
- gdk_pixbuf_unref (img);
+ g_object_unref (G_OBJECT (img));
} else if (defhostimg != NULL) {
- host->picture = gdk_pixbuf_ref (defhostimg);
+ host->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defhostimg));
}
g_free (hostimg);
@@ -916,12 +916,8 @@ static void
gdm_chooser_gui_init (void)
{
glade_helper_add_glade_directory (GDM_GLADE_DIR);
+ glade_helper_search_gnome_dirs (FALSE);
-#if 0
- GtkStyle *style;
- GdkColor bbg = { 0, 0xFFFF, 0xFFFF, 0xFFFF };
-#endif
-
/* Enable theme */
if (GdmGtkRC)
gtk_rc_parse (GdmGtkRC);
@@ -1027,14 +1023,18 @@ set_background (void)
gdk_color_parse ("#007777", &color);
}
- colormap = gdk_window_get_colormap (GDK_ROOT_PARENT ());
+ colormap = gdk_drawable_get_colormap
+ (gdk_get_default_root_window ());
/* paranoia */
if (colormap != NULL) {
+ gboolean success;
gdk_error_trap_push ();
- gdk_color_alloc (colormap, &color);
- gdk_window_set_background (GDK_ROOT_PARENT (), &color);
- gdk_window_clear (GDK_ROOT_PARENT ());
+ 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 ();
diff --git a/gui/gdmcomm.c b/gui/gdmcomm.c
index c3b402ca..8e199e32 100644
--- a/gui/gdmcomm.c
+++ b/gui/gdmcomm.c
@@ -20,7 +20,7 @@
#include "config.h"
#include <libgnome/libgnome.h>
-#include <libgnomeui/libgnomeui.h>
+#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <X11/Xauth.h>
@@ -269,8 +269,9 @@ gdmcomm_get_a_cookie (gboolean binary)
str = g_string_new (NULL);
for (i = 0; i < xau->data_length; i++) {
- g_string_sprintfa (str, "%02x",
- (guint)(guchar)xau->data[i]);
+ g_string_append_printf
+ (str, "%02x",
+ (guint)(guchar)xau->data[i]);
}
cookie = g_string_free (str, FALSE);
}
@@ -365,9 +366,8 @@ gdmcomm_check (gboolean gui_bitching)
long pid;
char *pidfile;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- pidfile = gnome_config_get_string (GDM_KEY_PIDFILE);
- gnome_config_pop_prefix ();
+ pidfile = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_PIDFILE);
pid = 0;
if (pidfile != NULL)
@@ -382,21 +382,33 @@ gdmcomm_check (gboolean gui_bitching)
(kill (pid, 0) < 0 &&
errno != EPERM)) {
if (gui_bitching) {
- dialog = gnome_warning_dialog
- (_("GDM is not running.\n"
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("GDM is not running.\n"
"Please ask your "
"system administrator to start it."));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
}
return FALSE;
}
if (access (GDM_SUP_SOCKET, R_OK|W_OK)) {
if (gui_bitching) {
- dialog = gnome_warning_dialog
- (_("Cannot communicate with gdm, perhaps "
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("Cannot communicate with gdm, perhaps "
"you have an old version running."));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
}
return FALSE;
}
diff --git a/gui/gdmflexiserver.c b/gui/gdmflexiserver.c
index 56936d17..99c2de8b 100644
--- a/gui/gdmflexiserver.c
+++ b/gui/gdmflexiserver.c
@@ -126,11 +126,15 @@ choose_server (void)
got_standard)
return g_strdup (GDM_STANDARD);
- dialog = gnome_dialog_new (_("Choose server"),
- GNOME_STOCK_BUTTON_OK,
- GNOME_STOCK_BUTTON_CANCEL,
- NULL);
- vbox = GNOME_DIALOG (dialog)->vbox;
+ 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);
+ 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);
@@ -141,7 +145,7 @@ choose_server (void)
_("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_group (GTK_RADIO_BUTTON (w));
+ group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
}
for (li = xservers; li != NULL; li = li->next) {
@@ -153,16 +157,14 @@ choose_server (void)
strcmp (svr->id, GDM_STANDARD) == 0)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w),
TRUE);
- gtk_object_set_user_data (GTK_OBJECT (w), svr->id);
- group = gtk_radio_button_group (GTK_RADIO_BUTTON (w));
+ 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);
- gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
-
- switch (gnome_dialog_run_and_close (GNOME_DIALOG (dialog))) {
- case 0:
+ switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
+ case GTK_RESPONSE_OK:
/* OK */
break;
default:
@@ -174,7 +176,7 @@ choose_server (void)
for (li = group; li != NULL; li = li->next) {
GtkWidget *w = li->data;
- char *name = gtk_object_get_user_data (GTK_OBJECT (w));
+ char *name = g_object_get_data (G_OBJECT (w), "ServerID");
if (GTK_TOGGLE_BUTTON (w)->active) {
gtk_widget_destroy (dialog);
return g_strdup (name);
@@ -209,13 +211,20 @@ main (int argc, char *argv[])
char *auth_cookie = NULL;
poptContext ctx;
const char **args;
+ GnomeProgram *program;
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- gnome_init_with_popt_table ("gdmflexiserver", VERSION, argc, argv,
- options, 0, &ctx);
+ program = gnome_program_init ("gdmflexiserver", VERSION,
+ LIBGNOMEUI_MODULE /* module_info */,
+ argc, argv,
+ GNOME_PARAM_POPT_TABLE, options,
+ NULL);
+ g_object_get (G_OBJECT (program),
+ GNOME_PARAM_POPT_CONTEXT, &ctx,
+ NULL);
gdmcomm_set_debug (debug);
@@ -235,10 +244,16 @@ main (int argc, char *argv[])
g_print ("%s\n", ret);
return 0;
} else {
- dialog = gnome_warning_dialog
- (_("Cannot communicate with gdm, perhaps "
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("Cannot communicate with gdm, perhaps "
"you have an old version running."));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
return 1;
}
}
@@ -246,12 +261,18 @@ main (int argc, char *argv[])
if (use_xnest) {
char *cookie = gdmcomm_get_a_cookie (FALSE /* binary */);
if (cookie == NULL) {
- dialog = gnome_warning_dialog
- (_("You do not seem to have the "
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("You do not seem to have the "
"authentication needed for this "
"operation. Perhaps your .Xauthority "
"file is not set up correctly."));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ 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",
@@ -266,11 +287,17 @@ main (int argc, char *argv[])
auth_cookie = gdmcomm_get_auth_cookie ();
if (auth_cookie == NULL) {
- dialog = gnome_warning_dialog
- (_("You do not seem to be logged in on the "
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ _("You do not seem to be logged in on the "
"console. Starting a new login only "
"works correctly on the console."));
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
return 1;
}
@@ -305,8 +332,16 @@ main (int argc, char *argv[])
message = gdmcomm_get_error_message (ret, use_xnest);
- dialog = gnome_warning_dialog (message);
- gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+ dialog = gtk_message_dialog_new
+ (NULL /* parent */,
+ GTK_DIALOG_MODAL /* flags */,
+ GTK_MESSAGE_WARNING,
+ GTK_BUTTONS_OK,
+ "%s", message);
+ gtk_widget_show_all (dialog);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+
return 1;
}
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index a5c74f38..48f49f35 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -17,6 +17,10 @@
*/
#include <config.h>
+
+/* for GtkCList */
+#undef GTK_DISABLE_DEPRECATED
+
#include <libgnome/libgnome.h>
#include <libgnomeui/libgnomeui.h>
#include <math.h>
@@ -264,8 +268,8 @@ static void
setup_cursor (GdkCursorType type)
{
GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (GDK_ROOT_PARENT (), cursor);
- gdk_cursor_destroy (cursor);
+ gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
+ gdk_cursor_unref (cursor);
}
static void
@@ -373,7 +377,7 @@ gdm_login_icon_pressed (GtkWidget *widget, GdkEventButton *event)
NULL,
fleur_cursor,
GDK_CURRENT_TIME);
- gdk_cursor_destroy (fleur_cursor);
+ gdk_cursor_unref (fleur_cursor);
gdk_flush ();
return TRUE;
@@ -419,7 +423,8 @@ gdm_login_icon_motion (GtkWidget *widget, GdkEventMotion *event)
if (p == NULL)
return FALSE;
- gdk_window_get_pointer (GDK_ROOT_PARENT (), &xp, &yp, &mask);
+ gdk_window_get_pointer (gdk_get_default_root_window (),
+ &xp, &yp, &mask);
set_screen_to_pos (xp, yp);
@@ -461,7 +466,7 @@ gdm_login_iconify_handler (GtkWidget *widget, gpointer data)
icon = gtk_image_new_from_pixbuf (pb);
iw = gdk_pixbuf_get_width (pb);
ih = gdk_pixbuf_get_height (pb);
- gdk_pixbuf_unref (pb);
+ g_object_unref (G_OBJECT (pb));
} else {
/* sanity fallback */
icon = gtk_event_box_new ();
@@ -789,63 +794,64 @@ static void
gdm_login_parse_config (void)
{
struct stat unused;
+ VeConfig *config;
if (stat (GDM_CONFIG_FILE, &unused) == -1) {
syslog (LOG_ERR, _("gdm_login_parse_config: No configuration file: %s. Using defaults."), GDM_CONFIG_FILE);
used_defaults = TRUE;
}
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- GdmAllowRoot = gnome_config_get_bool (GDM_KEY_ALLOWROOT);
- GdmAllowRemoteRoot = gnome_config_get_bool (GDM_KEY_ALLOWREMOTEROOT);
- GdmBrowser = gnome_config_get_bool (GDM_KEY_BROWSER);
- GdmLogo = gnome_config_get_string (GDM_KEY_LOGO);
- GdmIcon = gnome_config_get_string (GDM_KEY_ICON);
- GdmQuiver = gnome_config_get_bool (GDM_KEY_QUIVER);
- GdmSystemMenu = gnome_config_get_bool (GDM_KEY_SYSMENU);
- GdmHalt = gnome_config_get_string (GDM_KEY_HALT);
- GdmReboot = gnome_config_get_string (GDM_KEY_REBOOT);
- GdmSuspend = gnome_config_get_string (GDM_KEY_SUSPEND);
- GdmConfigAvailable = gnome_config_get_bool (GDM_KEY_CONFIG_AVAILABLE);
- GdmConfigurator = gnome_config_get_string (GDM_KEY_CONFIGURATOR);
- GdmTitleBar = gnome_config_get_bool (GDM_KEY_TITLE_BAR);
- GdmLocaleFile = gnome_config_get_string (GDM_KEY_LOCFILE);
- GdmDefaultLocale = gnome_config_get_string (GDM_KEY_LOCALE);
- GdmSessionDir = gnome_config_get_string (GDM_KEY_SESSDIR);
- GdmWelcome = gnome_config_get_translated_string (GDM_KEY_WELCOME);
+ config = ve_config_get (GDM_CONFIG_FILE);
+
+ GdmAllowRoot = ve_config_get_bool (config, GDM_KEY_ALLOWROOT);
+ GdmAllowRemoteRoot = ve_config_get_bool (config, GDM_KEY_ALLOWREMOTEROOT);
+ GdmBrowser = ve_config_get_bool (config, GDM_KEY_BROWSER);
+ GdmLogo = ve_config_get_string (config, GDM_KEY_LOGO);
+ GdmIcon = ve_config_get_string (config, GDM_KEY_ICON);
+ GdmQuiver = ve_config_get_bool (config, GDM_KEY_QUIVER);
+ GdmSystemMenu = ve_config_get_bool (config, GDM_KEY_SYSMENU);
+ GdmHalt = ve_config_get_string (config, GDM_KEY_HALT);
+ GdmReboot = ve_config_get_string (config, GDM_KEY_REBOOT);
+ GdmSuspend = ve_config_get_string (config, GDM_KEY_SUSPEND);
+ GdmConfigAvailable = ve_config_get_bool (config, GDM_KEY_CONFIG_AVAILABLE);
+ GdmConfigurator = ve_config_get_string (config, GDM_KEY_CONFIGURATOR);
+ GdmTitleBar = ve_config_get_bool (config, GDM_KEY_TITLE_BAR);
+ GdmLocaleFile = ve_config_get_string (config, GDM_KEY_LOCFILE);
+ GdmDefaultLocale = ve_config_get_string (config, GDM_KEY_LOCALE);
+ GdmSessionDir = ve_config_get_string (config, GDM_KEY_SESSDIR);
+ GdmWelcome = ve_config_get_translated_string (config, GDM_KEY_WELCOME);
/* A hack! */
if (strcmp (ve_sure_string (GdmWelcome), "Welcome to %n") == 0) {
g_free (GdmWelcome);
GdmWelcome = g_strdup (_("Welcome to %n"));
}
- GdmBackgroundProg = gnome_config_get_string (GDM_KEY_BACKGROUNDPROG);
- GdmBackgroundImage = gnome_config_get_string (GDM_KEY_BACKGROUNDIMAGE);
- GdmBackgroundColor = gnome_config_get_string (GDM_KEY_BACKGROUNDCOLOR);
- GdmBackgroundType = gnome_config_get_int (GDM_KEY_BACKGROUNDTYPE);
- GdmBackgroundScaleToFit = gnome_config_get_bool (GDM_KEY_BACKGROUNDSCALETOFIT);
- GdmBackgroundRemoteOnlyColor = gnome_config_get_bool (GDM_KEY_BACKGROUNDREMOTEONLYCOLOR);
- GdmGtkRC = gnome_config_get_string (GDM_KEY_GTKRC);
- GdmExclude = gnome_config_get_string (GDM_KEY_EXCLUDE);
- GdmMinimalUID = gnome_config_get_int (GDM_KEY_MINIMALUID);
- GdmGlobalFaceDir = gnome_config_get_string (GDM_KEY_FACEDIR);
- GdmDefaultFace = gnome_config_get_string (GDM_KEY_FACE);
- GdmDebug = gnome_config_get_bool (GDM_KEY_DEBUG);
- GdmIconMaxWidth = gnome_config_get_int (GDM_KEY_ICONWIDTH);
- GdmIconMaxHeight = gnome_config_get_int (GDM_KEY_ICONHEIGHT);
- GdmXineramaScreen = gnome_config_get_int (GDM_KEY_XINERAMASCREEN);
- GdmUseCirclesInEntry = gnome_config_get_bool (GDM_KEY_ENTRY_CIRCLES);
- GdmLockPosition = gnome_config_get_bool (GDM_KEY_LOCK_POSITION);
- GdmSetPosition = gnome_config_get_bool (GDM_KEY_SET_POSITION);
- GdmPositionX = gnome_config_get_int (GDM_KEY_POSITIONX);
- GdmPositionY = gnome_config_get_int (GDM_KEY_POSITIONY);
-
- GdmShowXtermFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE);
- GdmShowGnomeFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE);
- GdmShowGnomeChooserSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_CHOOSER);
- GdmShowLastSession = gnome_config_get_bool (GDM_KEY_SHOW_LAST_SESSION);
+ GdmBackgroundProg = ve_config_get_string (config, GDM_KEY_BACKGROUNDPROG);
+ GdmBackgroundImage = ve_config_get_string (config, GDM_KEY_BACKGROUNDIMAGE);
+ GdmBackgroundColor = ve_config_get_string (config, GDM_KEY_BACKGROUNDCOLOR);
+ GdmBackgroundType = ve_config_get_int (config, GDM_KEY_BACKGROUNDTYPE);
+ GdmBackgroundScaleToFit = ve_config_get_bool (config, GDM_KEY_BACKGROUNDSCALETOFIT);
+ GdmBackgroundRemoteOnlyColor = ve_config_get_bool (config, GDM_KEY_BACKGROUNDREMOTEONLYCOLOR);
+ GdmGtkRC = ve_config_get_string (config, GDM_KEY_GTKRC);
+ GdmExclude = ve_config_get_string (config, GDM_KEY_EXCLUDE);
+ GdmMinimalUID = ve_config_get_int (config, GDM_KEY_MINIMALUID);
+ GdmGlobalFaceDir = ve_config_get_string (config, GDM_KEY_FACEDIR);
+ GdmDefaultFace = ve_config_get_string (config, GDM_KEY_FACE);
+ GdmDebug = ve_config_get_bool (config, GDM_KEY_DEBUG);
+ GdmIconMaxWidth = ve_config_get_int (config, GDM_KEY_ICONWIDTH);
+ GdmIconMaxHeight = ve_config_get_int (config, GDM_KEY_ICONHEIGHT);
+ GdmXineramaScreen = ve_config_get_int (config, GDM_KEY_XINERAMASCREEN);
+ GdmUseCirclesInEntry = ve_config_get_bool (config, GDM_KEY_ENTRY_CIRCLES);
+ GdmLockPosition = ve_config_get_bool (config, GDM_KEY_LOCK_POSITION);
+ GdmSetPosition = ve_config_get_bool (config, GDM_KEY_SET_POSITION);
+ GdmPositionX = ve_config_get_int (config, GDM_KEY_POSITIONX);
+ GdmPositionY = ve_config_get_int (config, GDM_KEY_POSITIONY);
+
+ GdmShowXtermFailsafeSession = ve_config_get_bool (config, GDM_KEY_SHOW_XTERM_FAILSAFE);
+ GdmShowGnomeFailsafeSession = ve_config_get_bool (config, GDM_KEY_SHOW_GNOME_FAILSAFE);
+ GdmShowGnomeChooserSession = ve_config_get_bool (config, GDM_KEY_SHOW_GNOME_CHOOSER);
+ GdmShowLastSession = ve_config_get_bool (config, GDM_KEY_SHOW_LAST_SESSION);
- GdmTimedLoginEnable = gnome_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE);
+ GdmTimedLoginEnable = ve_config_get_bool (config, GDM_KEY_TIMED_LOGIN_ENABLE);
/* Note: TimedLogin here is not gotten out of the config
* but from the daemon since it's been munged on by the daemon a bit
@@ -858,7 +864,7 @@ gdm_login_parse_config (void)
}
GdmTimedLoginDelay =
- gnome_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
+ ve_config_get_int (config, GDM_KEY_TIMED_LOGIN_DELAY);
if (GdmTimedLoginDelay < 5) {
syslog (LOG_WARNING,
_("TimedLoginDelay was less then 5. I'll just use 5."));
@@ -869,9 +875,7 @@ gdm_login_parse_config (void)
GdmTimedLoginDelay = 5;
}
- GdmUse24Clock = gnome_config_get_bool (GDM_KEY_USE_24_CLOCK);
-
- gnome_config_pop_prefix();
+ GdmUse24Clock = ve_config_get_bool (config, GDM_KEY_USE_24_CLOCK);
if (GdmIconMaxWidth < 0) GdmIconMaxWidth = 128;
if (GdmIconMaxHeight < 0) GdmIconMaxHeight = 128;
@@ -1331,7 +1335,7 @@ gdm_login_session_init (GtkWidget *menu)
g_object_set_data (G_OBJECT (item),
SESSION_NAME,
LAST_SESSION);
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ 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),
@@ -1410,7 +1414,7 @@ gdm_login_session_init (GtkWidget *menu)
g_strdup (dent->d_name),
(GDestroyNotify) g_free);
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions, g_strdup (dent->d_name));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
g_signal_connect (G_OBJECT (item), "activate",
@@ -1460,7 +1464,7 @@ gdm_login_session_init (GtkWidget *menu)
SESSION_NAME,
GDM_SESSION_GNOME_CHOOSER);
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions,
g_strdup (GDM_SESSION_GNOME_CHOOSER));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@@ -1507,7 +1511,7 @@ gdm_login_session_init (GtkWidget *menu)
g_object_set_data (G_OBJECT (item),
SESSION_NAME, GDM_SESSION_FAILSAFE_GNOME);
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions,
g_strdup (GDM_SESSION_FAILSAFE_GNOME));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@@ -1532,7 +1536,7 @@ gdm_login_session_init (GtkWidget *menu)
g_object_set_data (G_OBJECT (item),
SESSION_NAME, GDM_SESSION_FAILSAFE_XTERM);
- sessgrp = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ sessgrp = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
sessions = g_slist_append (sessions,
g_strdup (GDM_SESSION_FAILSAFE_XTERM));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
@@ -1616,7 +1620,7 @@ gdm_login_language_menu_new (void)
curlang = LAST_LANGUAGE;
item = gtk_radio_menu_item_new_with_label (NULL, _("Last"));
- languages = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ 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),
@@ -1631,7 +1635,7 @@ gdm_login_language_menu_new (void)
NULL);
item = gtk_radio_menu_item_new_with_label (languages, _("System default"));
- languages = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ 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),
@@ -1715,7 +1719,7 @@ gdm_login_language_menu_new (void)
item = gtk_radio_menu_item_new (languages);
gtk_container_add (GTK_CONTAINER (item), box);
- languages = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (item));
+ languages = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item));
g_object_set_data_full (G_OBJECT (item),
"Language",
g_strdup (lang),
@@ -1980,7 +1984,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
/* Read random garbage from i/o channel until STX is found */
do {
- g_io_channel_read (source, buf, 1, &len);
+ g_io_channel_read_chars (source, buf, 1, &len, NULL);
if (len != 1)
return (TRUE);
@@ -1988,7 +1992,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
/* Read opcode */
- g_io_channel_read (source, buf, 1, &len);
+ g_io_channel_read_chars (source, buf, 1, &len, NULL);
/* If opcode couldn't be read */
if (len != 1)
@@ -1999,7 +2003,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
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_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
g_free (curuser);
curuser = g_strdup (buf);
@@ -2007,7 +2011,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
fflush (stdout);
break;
case GDM_LOGIN:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -2038,7 +2042,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_PROMPT:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -2069,7 +2073,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_NOECHO:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -2100,7 +2104,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_MSG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
/* the user has not yet seen messages */
@@ -2138,7 +2142,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_ERRBOX:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
gtk_label_set_text (GTK_LABEL (err_box), tmp);
@@ -2156,7 +2160,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_ERRDLG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
/* we should be now fine for focusing new windows */
@@ -2183,7 +2187,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_SESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
gdm_login_session_lookup (tmp);
@@ -2195,7 +2199,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_LANG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
gdm_login_language_lookup (buf);
printf ("%c%s\n", STX, language);
@@ -2203,7 +2207,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_SSESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (savesess)
printf ("%cY\n", STX);
@@ -2214,7 +2218,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_SLANG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (savelang)
printf ("%cY\n", STX);
@@ -2247,7 +2251,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
/* fall thru to reset */
case GDM_RESETOK:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
if (curuser != NULL) {
@@ -2271,7 +2275,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_QUIT:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (timed_handler_id != 0) {
gtk_timeout_remove (timed_handler_id);
@@ -2343,7 +2347,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
GString *str = g_string_new (NULL);
do {
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
g_string_append (str, tmp);
@@ -2365,7 +2369,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_SGNOMESESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (remember_gnome_session)
printf ("%cY\n", STX);
@@ -2376,7 +2380,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_STARTTIMER:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
/*
* Timed Login: Start Timer Loop
@@ -2394,7 +2398,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_STOPTIMER:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
/*
* Timed Login: Stop Timer Loop
@@ -2409,14 +2413,14 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_DISABLE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gtk_widget_set_sensitive (login, FALSE);
printf ("%c\n", STX);
fflush (stdout);
break;
case GDM_ENABLE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gtk_widget_set_sensitive (login, TRUE);
printf ("%c\n", STX);
fflush (stdout);
@@ -2426,13 +2430,13 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
* back a NULL response so that the daemon quits sending them */
case GDM_NEEDPIC:
case GDM_READPIC:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
printf ("%c\n", STX);
fflush (stdout);
break;
case GDM_NOFOCUS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gdm_wm_no_login_focus_push ();
@@ -2441,7 +2445,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_FOCUS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gdm_wm_no_login_focus_pop ();
@@ -2450,7 +2454,7 @@ gdm_login_ctrl_handler (GIOChannel *source, GIOCondition cond, gint fd)
break;
case GDM_SAVEDIE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
/* Set busy cursor */
setup_cursor (GDK_WATCH);
@@ -2603,7 +2607,7 @@ gdm_login_handle_pressed (GtkWidget *widget, GdkEventButton *event)
NULL,
fleur_cursor,
GDK_CURRENT_TIME);
- gdk_cursor_destroy (fleur_cursor);
+ gdk_cursor_unref (fleur_cursor);
gdk_flush ();
return TRUE;
@@ -2633,7 +2637,7 @@ gdm_login_handle_motion (GtkWidget *widget, GdkEventMotion *event)
if (p == NULL)
return FALSE;
- gdk_window_get_pointer (GDK_ROOT_PARENT (), &xp, &yp, &mask);
+ gdk_window_get_pointer (gdk_get_default_root_window (), &xp, &yp, &mask);
set_screen_to_pos (xp, yp);
@@ -3155,7 +3159,7 @@ gdm_login_gui_init (void)
logo = gtk_image_new_from_pixbuf (pb);
lw = gdk_pixbuf_get_width (pb);
lh = gdk_pixbuf_get_height (pb);
- gdk_pixbuf_unref (pb);
+ g_object_unref (G_OBJECT (pb));
/* this will make the logo always left justified */
logoframe = gtk_alignment_new (0, 0.5, 0, 0);
@@ -3392,7 +3396,7 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir)
user->login = g_strdup (logname);
user->homedir = g_strdup (homedir);
if (defface != NULL)
- user->picture = gdk_pixbuf_ref (defface);
+ user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));
/* don't read faces, since that requires the daemon */
if (DOING_GDM_DEVELOPMENT)
@@ -3485,7 +3489,7 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir)
}
if (user->picture != NULL)
- gdk_pixbuf_unref (user->picture);
+ g_object_unref (G_OBJECT (user->picture));
maxwidth = MAX (maxwidth, w);
maxheight = MAX (maxheight, h);
@@ -3493,7 +3497,7 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir)
h != gdk_pixbuf_get_height (img)) {
user->picture = gdk_pixbuf_scale_simple
(img, w, h, GDK_INTERP_BILINEAR);
- gdk_pixbuf_unref (img);
+ g_object_unref (G_OBJECT (img));
} else {
user->picture = img;
}
@@ -3624,13 +3628,13 @@ set_root (GdkPixbuf *pb)
gdk_error_trap_push ();
- gdk_window_set_back_pixmap (GDK_ROOT_PARENT (),
+ gdk_window_set_back_pixmap (gdk_get_default_root_window (),
pm,
FALSE /* parent_relative */);
- gdk_pixmap_unref (pm);
+ g_object_unref (G_OBJECT (pm));
- gdk_window_clear (GDK_ROOT_PARENT ());
+ gdk_window_clear (gdk_get_default_root_window ());
gdk_flush ();
gdk_error_trap_pop ();
@@ -3725,14 +3729,14 @@ run_backgrounds (void)
}
if (GdmBackgroundScaleToFit) {
GdkPixbuf *spb = render_scaled_back (pb);
- gdk_pixbuf_unref (pb);
+ g_object_unref (G_OBJECT (pb));
pb = spb;
}
/* paranoia */
if (pb != NULL) {
set_root (pb);
- gdk_pixbuf_unref (pb);
+ g_object_unref (G_OBJECT (pb));
}
}
/* Load background color */
@@ -3745,14 +3749,17 @@ run_backgrounds (void)
gdk_color_parse ("#007777", &color);
}
- colormap = gdk_window_get_colormap (GDK_ROOT_PARENT ());
+ colormap = gdk_drawable_get_colormap
+ (gdk_get_default_root_window ());
/* paranoia */
if (colormap != NULL) {
+ gboolean success;
gdk_error_trap_push ();
- gdk_color_alloc (colormap, &color);
- gdk_window_set_background (GDK_ROOT_PARENT (), &color);
- gdk_window_clear (GDK_ROOT_PARENT ());
+ 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 ();
@@ -3774,9 +3781,9 @@ enum {
};
static gboolean
-string_same (const char *cur, const char *key)
+string_same (VeConfig *config, const char *cur, const char *key)
{
- char *val = gnome_config_get_string (key);
+ char *val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (cur), ve_sure_string (val)) == 0) {
g_free (val);
return TRUE;
@@ -3787,9 +3794,9 @@ string_same (const char *cur, const char *key)
}
static gboolean
-bool_same (gboolean cur, const char *key)
+bool_same (VeConfig *config, gboolean cur, const char *key)
{
- gboolean val = gnome_config_get_bool (key);
+ gboolean val = ve_config_get_bool (config, key);
if (ve_bool_equal (cur, val)) {
return TRUE;
} else {
@@ -3798,9 +3805,9 @@ bool_same (gboolean cur, const char *key)
}
static gboolean
-int_same (int cur, const char *key)
+int_same (VeConfig *config, int cur, const char *key)
{
- int val = gnome_config_get_int (key);
+ int val = ve_config_get_int (config, key);
if (cur == val) {
return TRUE;
} else {
@@ -3808,35 +3815,36 @@ int_same (int cur, const char *key)
}
}
-static void
-gdm_reread_config (int sig)
+static gboolean
+gdm_reread_config (int sig, gpointer data)
{
char *str;
+ VeConfig *config;
/* reparse config stuff here. At least ones we care about */
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
+ config = ve_config_get (GDM_CONFIG_FILE);
/* 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 ( ! string_same (GdmBackgroundProg, GDM_KEY_BACKGROUNDPROG) ||
- ! string_same (GdmBackgroundImage, GDM_KEY_BACKGROUNDIMAGE) ||
- ! string_same (GdmBackgroundColor, GDM_KEY_BACKGROUNDCOLOR) ||
- ! int_same (GdmBackgroundType, GDM_KEY_BACKGROUNDTYPE) ||
- ! bool_same (GdmBackgroundScaleToFit,
+ if ( ! string_same (config, GdmBackgroundProg, GDM_KEY_BACKGROUNDPROG) ||
+ ! string_same (config, GdmBackgroundImage, GDM_KEY_BACKGROUNDIMAGE) ||
+ ! string_same (config, GdmBackgroundColor, GDM_KEY_BACKGROUNDCOLOR) ||
+ ! int_same (config, GdmBackgroundType, GDM_KEY_BACKGROUNDTYPE) ||
+ ! bool_same (config,
+ GdmBackgroundScaleToFit,
GDM_KEY_BACKGROUNDSCALETOFIT) ||
- ! bool_same (GdmBackgroundRemoteOnlyColor,
+ ! bool_same (config,
+ GdmBackgroundRemoteOnlyColor,
GDM_KEY_BACKGROUNDREMOTEONLYCOLOR) ||
- ! string_same (GdmGtkRC, GDM_KEY_GTKRC) ||
- ! int_same (GdmXineramaScreen, GDM_KEY_XINERAMASCREEN) ||
- ! string_same (GdmLogo, GDM_KEY_LOGO) ||
- ! bool_same (GdmSystemMenu, GDM_KEY_SYSMENU) ||
- ! bool_same (GdmBrowser, GDM_KEY_BROWSER) ||
- ! bool_same (GdmConfigAvailable, GDM_KEY_CONFIG_AVAILABLE) ||
- ! bool_same (GdmTimedLoginEnable, GDM_KEY_TIMED_LOGIN_ENABLE)) {
- /* restart interruption */
- gnome_config_pop_prefix ();
-
+ ! string_same (config, GdmGtkRC, GDM_KEY_GTKRC) ||
+ ! int_same (config,
+ GdmXineramaScreen, GDM_KEY_XINERAMASCREEN) ||
+ ! string_same (config, GdmLogo, GDM_KEY_LOGO) ||
+ ! bool_same (config, GdmSystemMenu, GDM_KEY_SYSMENU) ||
+ ! bool_same (config, GdmBrowser, GDM_KEY_BROWSER) ||
+ ! bool_same (config, GdmConfigAvailable, GDM_KEY_CONFIG_AVAILABLE) ||
+ ! bool_same (config, GdmTimedLoginEnable, GDM_KEY_TIMED_LOGIN_ENABLE)) {
/* Set busy cursor */
setup_cursor (GDK_WATCH);
@@ -3844,22 +3852,24 @@ gdm_reread_config (int sig)
kill_thingies ();
_exit (DISPLAY_RESTARTGREETER);
- return;
+ return TRUE;
}
- GdmUse24Clock = gnome_config_get_bool (GDM_KEY_USE_24_CLOCK);
+ GdmUse24Clock = ve_config_get_bool (config, GDM_KEY_USE_24_CLOCK);
update_clock (NULL);
- str = gnome_config_get_string (GDM_KEY_LOGO);
+#ifdef FIXME
+ str = ve_config_get_string (config, GDM_KEY_LOGO);
if (strcmp (ve_sure_string (str), ve_sure_string (GdmLogo)) != 0) {
g_free (GdmLogo);
GdmLogo = str;
- /* FIXME: update logo */
+ /* FIXME: update logo (remove restart above) */
} else {
g_free (str);
}
+#endif
- str = gnome_config_get_translated_string (GDM_KEY_WELCOME);
+ str = ve_config_get_translated_string (config, GDM_KEY_WELCOME);
/* A hack */
if (strcmp (ve_sure_string (str), "Welcome to %n") == 0) {
g_free (str);
@@ -3879,8 +3889,7 @@ gdm_reread_config (int sig)
g_free (str);
}
-
- gnome_config_pop_prefix();
+ return TRUE;
}
int
@@ -4057,7 +4066,9 @@ main (int argc, char *argv[])
if (GdmBrowser)
gdm_login_browser_update();
- hup.sa_handler = gdm_reread_config;
+ 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);
@@ -4099,7 +4110,6 @@ main (int argc, char *argv[])
ctrlch = g_io_channel_unix_new (STDIN_FILENO);
g_io_channel_set_encoding (ctrlch, NULL, NULL);
g_io_channel_set_buffered (ctrlch, FALSE);
- g_io_channel_init (ctrlch);
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,
diff --git a/gui/gdmphotosetup.c b/gui/gdmphotosetup.c
index 076b1730..870fefca 100644
--- a/gui/gdmphotosetup.c
+++ b/gui/gdmphotosetup.c
@@ -90,9 +90,8 @@ main (int argc, char *argv[])
photo, TRUE, TRUE, 0);
if ( ! ve_string_empty (last_pix)) {
- GtkWidget *e = gnome_pixmap_entry_gtk_entry
- (GNOME_PIXMAP_ENTRY (photo));
- gtk_entry_set_text (GTK_ENTRY (e), last_pix);
+ gnome_file_entry_set_filename (GNOME_FILE_ENTRY (photo),
+ last_pix);
}
gtk_widget_show_all (dialog);
diff --git a/gui/gdmsetup.c b/gui/gdmsetup.c
index 09fb26f1..f4c16825 100644
--- a/gui/gdmsetup.c
+++ b/gui/gdmsetup.c
@@ -58,8 +58,8 @@ static void
setup_cursor (GdkCursorType type)
{
GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (GDK_ROOT_PARENT (), cursor);
- gdk_cursor_destroy (cursor);
+ gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
+ gdk_cursor_unref (cursor);
}
static void
@@ -70,6 +70,9 @@ update_greeters (void)
static gboolean shown_error = FALSE;
gboolean have_error = FALSE;
+ /* recheck for gdm */
+ gdm_running = gdmcomm_check (FALSE /* gui_bitching */);
+
if ( ! gdm_running)
return;
@@ -146,7 +149,13 @@ run_timeout (GtkWidget *widget, guint tm, gboolean (*func) (GtkWidget *))
static void
update_key (const char *notify_key)
{
- if (notify_key != NULL && gdm_running) {
+ if (notify_key == NULL)
+ return;
+
+ /* recheck for gdm */
+ gdm_running = gdmcomm_check (FALSE /* gui_bitching */);
+
+ if (gdm_running) {
char *ret;
char *s = g_strdup_printf ("%s %s", GDM_SUP_UPDATE_CONFIG,
notify_key);
@@ -165,21 +174,18 @@ toggle_timeout (GtkWidget *toggle)
const char *key = g_object_get_data (G_OBJECT (toggle), "key");
const char *notify_key = g_object_get_data (G_OBJECT (toggle),
"notify_key");
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
gboolean val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_bool (key);
+ val = ve_config_get_bool (config, key);
if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
- gnome_config_set_bool (key, GTK_TOGGLE_BUTTON (toggle)->active);
-
- gnome_config_sync ();
+ ve_config_set_bool (config, key,
+ GTK_TOGGLE_BUTTON (toggle)->active);
+ ve_config_save (config, FALSE /*force */);
update_key (notify_key);
}
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -189,25 +195,22 @@ entry_timeout (GtkWidget *entry)
const char *key = g_object_get_data (G_OBJECT (entry), "key");
const char *text;
char *val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
text = gtk_entry_get_text (GTK_ENTRY (entry));
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_string (key);
+ val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (val), ve_sure_string (text)) != 0) {
- gnome_config_set_string (key, ve_sure_string (text));
+ ve_config_set_string (config, key, ve_sure_string (text));
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_key (key);
}
g_free (val);
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -218,23 +221,20 @@ intspin_timeout (GtkWidget *spin)
const char *notify_key = g_object_get_data (G_OBJECT (spin),
"notify_key");
int val, new_val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
new_val = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin));
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_int (key);
+ val = ve_config_get_int (config, key);
if (val != new_val) {
- gnome_config_set_int (key, new_val);
+ ve_config_set_int (config, key, new_val);
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_key (notify_key);
}
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -262,25 +262,22 @@ option_timeout (GtkWidget *option_menu)
const char *key = g_object_get_data (G_OBJECT (option_menu), "key");
const char *new_val;
char *val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
new_val = get_str_from_option (GTK_OPTION_MENU (option_menu));
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_string (key);
+ val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (val), ve_sure_string (new_val)) != 0) {
- gnome_config_set_string (key, new_val);
+ ve_config_set_string (config, key, new_val);
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_key (key);
}
g_free (val);
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -333,9 +330,7 @@ setup_notify_toggle (const char *name,
GTK_TYPE_TOGGLE_BUTTON);
gboolean val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_bool (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_bool (ve_config_get (GDM_CONFIG_FILE), key);
g_object_set_data_full (G_OBJECT (toggle),
"key", g_strdup (key),
@@ -361,9 +356,7 @@ setup_user_combo (const char *name, const char *key)
struct passwd *pwent;
char *str;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- str = gnome_config_get_string (key);
- gnome_config_pop_prefix ();
+ str = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE), key);
/* normally empty */
users = g_list_append (users, g_strdup (""));
@@ -415,9 +408,7 @@ setup_intspin (const char *name,
GTK_TYPE_SPIN_BUTTON);
int val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_int (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_int (ve_config_get (GDM_CONFIG_FILE), key);
g_object_set_data_full (G_OBJECT (spin),
"key", g_strdup (key),
@@ -439,21 +430,19 @@ greeter_toggle_timeout (GtkWidget *toggle)
{
const char *key = g_object_get_data (G_OBJECT (toggle), "key");
gboolean val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_bool (key);
+ val = ve_config_get_bool (config, key);
if ( ! ve_bool_equal (val, GTK_TOGGLE_BUTTON (toggle)->active)) {
- gnome_config_set_bool (key, GTK_TOGGLE_BUTTON (toggle)->active);
+ ve_config_set_bool (config, key,
+ GTK_TOGGLE_BUTTON (toggle)->active);
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_greeters ();
}
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -471,9 +460,7 @@ setup_greeter_toggle (const char *name,
GTK_TYPE_TOGGLE_BUTTON);
gboolean val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_bool (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_bool (ve_config_get (GDM_CONFIG_FILE), key);
g_object_set_data_full (G_OBJECT (toggle),
"key", g_strdup (key),
@@ -493,19 +480,18 @@ greeter_color_timeout (GtkWidget *picker)
const char *key = g_object_get_data (G_OBJECT (picker), "key");
char *val, *color;
guint8 r, g, b;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
gnome_color_picker_get_i8 (GNOME_COLOR_PICKER (picker),
&r, &g, &b, NULL);
color = g_strdup_printf ("#%02x%02x%02x", (int)r, (int)g, (int)b);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_string (key);
+ val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (val), ve_sure_string (color)) != 0) {
- gnome_config_set_string (key, ve_sure_string (color));
+ ve_config_set_string (config, key, ve_sure_string (color));
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_greeters ();
}
@@ -513,8 +499,6 @@ greeter_color_timeout (GtkWidget *picker)
g_free (val);
g_free (color);
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -533,9 +517,7 @@ setup_greeter_color (const char *name,
GNOME_TYPE_COLOR_PICKER);
char *val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_string (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE), key);
g_object_set_data_full (G_OBJECT (picker),
"key", g_strdup (key),
@@ -562,23 +544,20 @@ greeter_editable_timeout (GtkWidget *editable)
{
const char *key = g_object_get_data (G_OBJECT (editable), "key");
char *text, *val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
text = gtk_editable_get_chars (GTK_EDITABLE (editable), 0, -1);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_string (key);
+ val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (val), ve_sure_string (text)) != 0) {
- gnome_config_set_string (key, ve_sure_string (text));
+ ve_config_set_string (config, key, ve_sure_string (text));
- gnome_config_sync ();
+ ve_config_save (config, FALSE /* force */);
update_greeters ();
}
- gnome_config_pop_prefix ();
-
g_free (text);
g_free (val);
@@ -599,9 +578,7 @@ setup_greeter_editable (const char *name,
char *val;
int pos;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_string (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE), key);
g_object_set_data_full (G_OBJECT (editable),
"key", g_strdup (key),
@@ -621,92 +598,29 @@ setup_greeter_editable (const char *name,
g_free (val);
}
-static void
-whack_translations (const char *fullkey)
-{
- char *section, *key, *p, *k, *v;
- void *iterator;
- GSList *to_clean, *li;
-
- section = g_strdup (fullkey);
- p = strchr (section, '/');
- if (p == NULL) {
- g_free (section);
- return;
- }
- *p = '\0';
- key = p+1;
- p = strchr (key, '=');
- if (p != NULL)
- *p = '\0';
-
-
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- to_clean = NULL;
- iterator = gnome_config_init_iterator (section);
- while ((iterator = gnome_config_iterator_next (iterator, &k, &v))
- != NULL) {
- p = strchr (k, '[');
- if (p != NULL) {
- *p = '\0';
- if (strcmp (key, k) == 0) {
- *p = '[';
- to_clean = g_slist_prepend
- (to_clean,
- g_strconcat (section, "/", k, NULL));
- }
- }
- g_free (k);
- g_free (v);
- }
-
- if (to_clean != NULL) {
- for (li = to_clean; li != NULL; li = li->next) {
- char *key = li->data;
- li->data = NULL;
-
- gnome_config_clean_key (key);
-
- g_free (key);
- }
-
- g_slist_free (to_clean);
-
- gnome_config_sync ();
- }
-
- gnome_config_pop_prefix ();
-
- g_free (section);
-}
-
static gboolean
greeter_entry_untranslate_timeout (GtkWidget *entry)
{
const char *key = g_object_get_data (G_OBJECT (entry), "key");
const char *text;
char *val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
text = gtk_entry_get_text (GTK_ENTRY (entry));
- whack_translations (key);
+ ve_config_delete_translations (config, key);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_string (key);
+ val = ve_config_get_string (config, key);
if (strcmp (ve_sure_string (val), ve_sure_string (text)) != 0) {
- gnome_config_set_string (key, ve_sure_string (text));
-
- gnome_config_sync ();
+ ve_config_set_string (config, key, ve_sure_string (text));
update_greeters ();
}
g_free (val);
- gnome_config_pop_prefix ();
+ ve_config_save (config, FALSE /* force */);
return FALSE;
}
@@ -724,9 +638,8 @@ setup_greeter_untranslate_entry (const char *name,
GtkWidget *entry = glade_helper_get (xml, name, GTK_TYPE_ENTRY);
char *val;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_translated_string (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_translated_string (ve_config_get (GDM_CONFIG_FILE),
+ key);
g_object_set_data_full (G_OBJECT (entry),
"key", g_strdup (key),
@@ -751,10 +664,9 @@ greeter_backselect_timeout (GtkWidget *toggle)
GTK_TYPE_TOGGLE_BUTTON);
GtkWidget *image_bg = glade_helper_get (xml, "sg_image_bg_rb",
GTK_TYPE_TOGGLE_BUTTON);
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
-
- val = gnome_config_get_int (GDM_KEY_BACKGROUNDTYPE);
+ val = ve_config_get_int (config, GDM_KEY_BACKGROUNDTYPE);
if (GTK_TOGGLE_BUTTON (no_bg)->active)
new_val = 0 /* No background */;
@@ -764,14 +676,12 @@ greeter_backselect_timeout (GtkWidget *toggle)
new_val = 2 /* Color */;
if (val != new_val) {
- gnome_config_set_int (GDM_KEY_BACKGROUNDTYPE, new_val);
- gnome_config_sync ();
+ ve_config_set_int (config, GDM_KEY_BACKGROUNDTYPE, new_val);
+ ve_config_save (config, FALSE /* force */);
update_greeters ();
}
- gnome_config_pop_prefix ();
-
return FALSE;
}
@@ -795,9 +705,8 @@ setup_greeter_backselect (void)
GtkWidget *color_bg = glade_helper_get (xml, "sg_color_bg_rb",
GTK_TYPE_TOGGLE_BUTTON);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_int (GDM_KEY_BACKGROUNDTYPE);
- gnome_config_pop_prefix ();
+ val = ve_config_get_int (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_BACKGROUNDTYPE);
if (val == 0)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (no_bg), TRUE);
@@ -845,9 +754,7 @@ setup_greeter_option (const char *name,
GtkWidget *option_menu = glade_helper_get (xml, name,
GTK_TYPE_OPTION_MENU);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_string (key);
- gnome_config_pop_prefix ();
+ val = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE), key);
if (val != NULL &&
strcmp (val, EXPANDED_BINDIR "/gdmlogin --disable-sound --disable-crash-dialog") == 0) {
@@ -1000,9 +907,8 @@ get_theme_dir (void)
{
char *theme_dir;
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- theme_dir = gnome_config_get_string (GDM_KEY_GRAPHICAL_THEME_DIR);
- gnome_config_pop_prefix ();
+ theme_dir = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_GRAPHICAL_THEME_DIR);
if (theme_dir == NULL ||
theme_dir[0] == '\0' ||
@@ -1107,10 +1013,11 @@ read_themes (GtkListStore *store, const char *theme_dir, DIR *dir,
GtkTreeIter *select_iter = NULL;
while ((dent = readdir (dir)) != NULL) {
- char *n, *key, *file, *name, *desc, *author, *copyright, *ss;
+ char *n, *file, *name, *desc, *author, *copyright, *ss;
char *full;
GtkTreeIter iter;
gboolean sel;
+ VeConfig *theme_file;
if (dent->d_name[0] == '.')
continue;
n = g_strconcat (theme_dir, "/", dent->d_name,
@@ -1125,11 +1032,10 @@ read_themes (GtkListStore *store, const char *theme_dir, DIR *dir,
continue;
}
- key = g_strconcat ("=", n, "=/GdmGreeterTheme/", NULL);
- gnome_config_push_prefix (key);
- g_free (key);
+ theme_file = ve_config_new (n);
- file = gnome_config_get_translated_string ("Greeter");
+ file = ve_config_get_translated_string
+ (theme_file, "GdmGreeterTheme/Greeter");
if (ve_string_empty (file)) {
g_free (file);
file = g_strconcat (dent->d_name, ".xml");
@@ -1141,7 +1047,6 @@ read_themes (GtkListStore *store, const char *theme_dir, DIR *dir,
g_free (file);
g_free (full);
g_free (n);
- gnome_config_pop_prefix ();
continue;
}
g_free (full);
@@ -1151,16 +1056,22 @@ read_themes (GtkListStore *store, const char *theme_dir, DIR *dir,
else
sel = FALSE;
- name = gnome_config_get_translated_string ("Name");
+ 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 = gnome_config_get_translated_string ("Description");
- author = gnome_config_get_translated_string ("Author");
- copyright = gnome_config_get_translated_string ("Copyright");
- ss = gnome_config_get_translated_string ("Screenshot");
- gnome_config_pop_prefix ();
+ 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,
@@ -1204,19 +1115,17 @@ static gboolean
greeter_theme_timeout (GtkWidget *toggle)
{
char *val;
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- val = gnome_config_get_string (GDM_KEY_GRAPHICAL_THEME);
+ val = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME);
if (strcmp (ve_sure_string (val),
ve_sure_string (selected_theme)) != 0) {
- gnome_config_set_string (GDM_KEY_GRAPHICAL_THEME,
- selected_theme);
- gnome_config_sync ();
+ ve_config_set_string (config, GDM_KEY_GRAPHICAL_THEME,
+ selected_theme);
+ ve_config_save (config, FALSE /* force */);
update_greeters ();
-
- gnome_config_pop_prefix ();
}
g_free (val);
@@ -1708,9 +1617,8 @@ setup_graphical_themes (void)
char *theme_dir = get_theme_dir ();
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- selected_theme = gnome_config_get_string (GDM_KEY_GRAPHICAL_THEME);
- gnome_config_pop_prefix ();
+ selected_theme = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_GRAPHICAL_THEME);
/* create list store */
store = gtk_list_store_new (THEME_NUM_COLUMNS,
@@ -2002,9 +1910,8 @@ main (int argc, char *argv[])
setup_cursor (GDK_WATCH);
/* If we are running under gdm parse the GDM gtkRC */
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- gtkrc = gnome_config_get_string (GDM_KEY_GTKRC);
- gnome_config_pop_prefix ();
+ gtkrc = ve_config_get_string (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_GTKRC);
if ( ! ve_string_empty (gtkrc))
gtk_rc_parse (gtkrc);
g_free (gtkrc);
@@ -2045,9 +1952,8 @@ main (int argc, char *argv[])
/* 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 */
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
- GdmMinimalUID = gnome_config_get_int (GDM_KEY_MINIMALUID);
- gnome_config_pop_prefix ();
+ GdmMinimalUID = ve_config_get_int (ve_config_get (GDM_CONFIG_FILE),
+ GDM_KEY_MINIMALUID);
setup_gui ();
diff --git a/gui/greeter/Makefile.am b/gui/greeter/Makefile.am
index 30acfce8..db2f44ee 100644
--- a/gui/greeter/Makefile.am
+++ b/gui/greeter/Makefile.am
@@ -1,7 +1,17 @@
-SUBDIRS = themes
+SUBDIRS = . themes
+
+## Process this file with automake to produce makefile.in
+CFLAGS = @CFLAGS@ -g -Wall \
+ -Wpointer-arith \
+ -Wmissing-prototypes -Wmissing-declarations
INCLUDES = \
-I. \
+ -DG_DISABLE_DEPRECATED \
+ -DGDK_DISABLE_DEPRECATED \
+ -DGDK_PIXBUF_DISABLE_DEPRECATED \
+ -DGTK_DISABLE_DEPRECATED \
+ -DGNOME_DISABLE_DEPRECATED \
-I$(top_srcdir)/gui \
-I$(top_srcdir)/daemon \
-I$(top_srcdir)/vicious-extensions \
diff --git a/gui/greeter/greeter.c b/gui/greeter/greeter.c
index a3193b5f..95d209c0 100644
--- a/gui/greeter/greeter.c
+++ b/gui/greeter/greeter.c
@@ -65,15 +65,17 @@ extern gboolean session_dir_whacked_out;
static void
greeter_parse_config (void)
{
+ VeConfig *config;
+
if (!g_file_test (GDM_CONFIG_FILE, G_FILE_TEST_EXISTS))
{
syslog (LOG_ERR, _("greeter_parse_config: No configuration file: %s. Using defaults."), GDM_CONFIG_FILE);
used_defaults = TRUE;
}
- gnome_config_push_prefix ("=" GDM_CONFIG_FILE "=/");
+ config = ve_config_get (GDM_CONFIG_FILE);
- GdmGraphicalTheme = gnome_config_get_string (GDM_KEY_GRAPHICAL_THEME);
+ GdmGraphicalTheme = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME);
if (GdmGraphicalTheme == NULL ||
GdmGraphicalTheme[0] == '\0')
{
@@ -81,31 +83,32 @@ greeter_parse_config (void)
GdmGraphicalTheme = g_strdup ("circles");
}
- GdmGraphicalThemeDir = gnome_config_get_string (GDM_KEY_GRAPHICAL_THEME_DIR);
+ GdmGraphicalThemeDir = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME_DIR);
if (GdmGraphicalThemeDir == NULL ||
! g_file_test (GdmGraphicalThemeDir, G_FILE_TEST_IS_DIR))
{
g_free (GdmGraphicalThemeDir);
GdmGraphicalThemeDir = g_strdup (GREETERTHEMEDIR);
}
- GdmDefaultLocale = gnome_config_get_string (GDM_KEY_LOCALE);
- GdmXineramaScreen = gnome_config_get_int (GDM_KEY_XINERAMASCREEN);
- GdmUseCirclesInEntry = gnome_config_get_bool (GDM_KEY_ENTRY_CIRCLES);
-
- GdmShowXtermFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_XTERM_FAILSAFE);
- GdmShowGnomeFailsafeSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_FAILSAFE);
- GdmShowGnomeChooserSession = gnome_config_get_bool (GDM_KEY_SHOW_GNOME_CHOOSER);
- GdmShowLastSession = gnome_config_get_bool (GDM_KEY_SHOW_LAST_SESSION);
- GdmSessionDir = gnome_config_get_string (GDM_KEY_SESSDIR);
- GdmLocaleFile = gnome_config_get_string (GDM_KEY_LOCFILE);
- GdmSystemMenu = gnome_config_get_bool (GDM_KEY_SYSMENU);
- GdmConfigAvailable = gnome_config_get_bool (GDM_KEY_CONFIG_AVAILABLE);
- GdmHalt = gnome_config_get_string (GDM_KEY_HALT);
- GdmReboot = gnome_config_get_string (GDM_KEY_REBOOT);
- GdmSuspend = gnome_config_get_string (GDM_KEY_SUSPEND);
- GdmConfigurator = gnome_config_get_string (GDM_KEY_CONFIGURATOR);
-
- GdmTimedLoginEnable = gnome_config_get_bool (GDM_KEY_TIMED_LOGIN_ENABLE);
+ GdmDefaultLocale = ve_config_get_string (config, GDM_KEY_LOCALE);
+ GdmXineramaScreen = ve_config_get_int (config, GDM_KEY_XINERAMASCREEN);
+ GdmUseCirclesInEntry = ve_config_get_bool (config, GDM_KEY_ENTRY_CIRCLES);
+
+ GdmShowXtermFailsafeSession = ve_config_get_bool (config, GDM_KEY_SHOW_XTERM_FAILSAFE);
+ GdmShowGnomeFailsafeSession = ve_config_get_bool (config, GDM_KEY_SHOW_GNOME_FAILSAFE);
+ GdmShowGnomeChooserSession = ve_config_get_bool (config, GDM_KEY_SHOW_GNOME_CHOOSER);
+ GdmShowLastSession = ve_config_get_bool (config, GDM_KEY_SHOW_LAST_SESSION);
+ GdmSessionDir = ve_config_get_string (config, GDM_KEY_SESSDIR);
+ GdmLocaleFile = ve_config_get_string (config, GDM_KEY_LOCFILE);
+ GdmSystemMenu = ve_config_get_bool (config, GDM_KEY_SYSMENU);
+ GdmConfigAvailable = ve_config_get_bool (config, GDM_KEY_CONFIG_AVAILABLE);
+ GdmHalt = ve_config_get_string (config, GDM_KEY_HALT);
+ GdmReboot = ve_config_get_string (config, GDM_KEY_REBOOT);
+ GdmSuspend = ve_config_get_string (config, GDM_KEY_SUSPEND);
+ GdmConfigurator = ve_config_get_string (config, GDM_KEY_CONFIGURATOR);
+
+ GdmTimedLoginEnable = ve_config_get_bool (config, GDM_KEY_TIMED_LOGIN_ENABLE);
+ GdmTimedLoginDelay = ve_config_get_int (config, GDM_KEY_TIMED_LOGIN_DELAY);
/* Note: TimedLogin here is not gotten out of the config
* but from the daemon since it's been munged on by the daemon a bit
@@ -119,8 +122,6 @@ greeter_parse_config (void)
GdmTimedLogin = NULL;
}
- GdmTimedLoginDelay =
- gnome_config_get_int (GDM_KEY_TIMED_LOGIN_DELAY);
if (GdmTimedLoginDelay < 5)
{
syslog (LOG_WARNING,
@@ -131,13 +132,10 @@ greeter_parse_config (void)
else
{
GdmTimedLogin = NULL;
- GdmTimedLoginDelay = 5;
}
greeter_current_delay = GdmTimedLoginDelay;
- GdmUse24Clock = gnome_config_get_bool (GDM_KEY_USE_24_CLOCK);
-
- gnome_config_pop_prefix();
+ GdmUse24Clock = ve_config_get_bool (config, GDM_KEY_USE_24_CLOCK);
if (GdmXineramaScreen < 0)
GdmXineramaScreen = 0;
@@ -147,8 +145,8 @@ static void
setup_cursor (GdkCursorType type)
{
GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (GDK_ROOT_PARENT (), cursor);
- gdk_cursor_destroy (cursor);
+ gdk_window_set_cursor (gdk_get_default_root_window (), cursor);
+ gdk_cursor_unref (cursor);
}
static gboolean
@@ -162,7 +160,6 @@ greeter_ctrl_handler (GIOChannel *source,
char *tmp;
char *session;
GreeterItemInfo *conversation_info;
- GreeterItemInfo *entry_info;
static GnomeCanvasItem *disabled_cover = NULL;
gchar *language;
@@ -172,14 +169,14 @@ greeter_ctrl_handler (GIOChannel *source,
/* Read random garbage from i/o channel until STX is found */
do {
- g_io_channel_read (source, buf, 1, &len);
+ g_io_channel_read_chars (source, buf, 1, &len, NULL);
if (len != 1)
return TRUE;
} while (buf[0] && buf[0] != STX);
/* Read opcode */
- g_io_channel_read (source, buf, 1, &len);
+ g_io_channel_read_chars (source, buf, 1, &len, NULL);
/* If opcode couldn't be read */
if (len != 1)
@@ -190,7 +187,7 @@ greeter_ctrl_handler (GIOChannel *source,
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_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
greeter_item_pam_set_user (buf);
@@ -198,7 +195,7 @@ greeter_ctrl_handler (GIOChannel *source,
fflush (stdout);
break;
case GDM_LOGIN:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -207,7 +204,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_PROMPT:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -216,7 +213,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_NOECHO:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -225,7 +222,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_MSG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
greeter_item_pam_message (tmp);
@@ -236,7 +233,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_ERRBOX:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -248,7 +245,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_ERRDLG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
/* we should be now fine for focusing new windows */
@@ -275,7 +272,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_SESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
@@ -289,7 +286,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_LANG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
buf[len-1] = '\0';
language = greeter_language_get_language (buf);
printf ("%c%s\n", STX, language);
@@ -298,7 +295,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_SSESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (greeter_save_session ())
printf ("%cY\n", STX);
@@ -309,7 +306,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_SLANG:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (greeter_language_get_save_language ())
printf ("%cY\n", STX);
@@ -323,7 +320,7 @@ greeter_ctrl_handler (GIOChannel *source,
/* fall thru to reset */
case GDM_RESETOK:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
buf[len-1] = '\0';
conversation_info = greeter_lookup_id ("pam-conversation");
@@ -342,7 +339,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_QUIT:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
greeter_item_timed_stop ();
greeter_item_pam_leftover_messages ();
@@ -362,7 +359,7 @@ greeter_ctrl_handler (GIOChannel *source,
GString *str = g_string_new (NULL);
do {
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len);
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL);
buf[len-1] = '\0';
tmp = ve_locale_to_utf8 (buf);
g_string_append (str, tmp);
@@ -384,7 +381,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_SGNOMESESS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
if (greeter_save_gnome_session ())
printf ("%cY\n", STX);
@@ -395,7 +392,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_STARTTIMER:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
greeter_item_timed_start ();
@@ -404,7 +401,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_STOPTIMER:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
greeter_item_timed_stop ();
@@ -413,7 +410,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_DISABLE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gtk_widget_set_sensitive (window, FALSE);
if (disabled_cover == NULL)
@@ -434,7 +431,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_ENABLE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gtk_widget_set_sensitive (window, TRUE);
if (disabled_cover != NULL)
@@ -451,13 +448,13 @@ greeter_ctrl_handler (GIOChannel *source,
* back a NULL response so that the daemon quits sending them */
case GDM_NEEDPIC:
case GDM_READPIC:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
printf ("%c\n", STX);
fflush (stdout);
break;
case GDM_NOFOCUS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gdm_wm_no_login_focus_push ();
@@ -466,7 +463,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_FOCUS:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
gdm_wm_no_login_focus_pop ();
@@ -475,7 +472,7 @@ greeter_ctrl_handler (GIOChannel *source,
break;
case GDM_SAVEDIE:
- g_io_channel_read (source, buf, PIPE_SIZE-1, &len); /* Empty */
+ g_io_channel_read_chars (source, buf, PIPE_SIZE-1, &len, NULL); /* Empty */
/* Set busy cursor */
setup_cursor (GDK_WATCH);
@@ -755,15 +752,139 @@ greeter_abort (const gchar *format, ...)
_exit (DISPLAY_ABORT);
}
-static void
-greeter_reread_config (int sig)
+static gboolean
+string_same (VeConfig *config, const char *cur, const char *key)
{
- /* Set busy cursor */
- setup_cursor (GDK_WATCH);
- /* FIXME: actually reparse config stuff here, instead of
- * just requesting a restart */
- gdm_wm_save_wm_order ();
- _exit (DISPLAY_RESTARTGREETER);
+ char *val = ve_config_get_string (config, key);
+ if (strcmp (ve_sure_string (cur), ve_sure_string (val)) == 0) {
+ g_free (val);
+ return TRUE;
+ } else {
+ syslog (LOG_ERR, "string not same: cur '%s' val '%s' key '%s'",
+ cur, val, key);
+ g_free (val);
+ return FALSE;
+ }
+}
+
+static gboolean
+bool_same (VeConfig *config, gboolean cur, const char *key)
+{
+ gboolean val = ve_config_get_bool (config, key);
+ if (ve_bool_equal (cur, val)) {
+ return TRUE;
+ } else {
+ syslog (LOG_ERR, "bool not same: cur '%d' val '%d' key '%s'",
+ cur, val, key);
+ return FALSE;
+ }
+}
+
+static gboolean
+int_same (VeConfig *config, int cur, const char *key)
+{
+ int val = ve_config_get_int (config, key);
+ if (cur == val) {
+ return TRUE;
+ } else {
+ syslog (LOG_ERR, "int not same: cur '%d' val '%d' key '%s'",
+ cur, val, key);
+ return FALSE;
+ }
+}
+
+
+static gboolean
+greeter_reread_config (int sig, gpointer data)
+{
+ VeConfig *config = ve_config_get (GDM_CONFIG_FILE);
+ char *theme, *theme_dir;
+
+ theme = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME);
+ if (ve_string_empty (theme)) {
+ g_free (theme);
+ theme = g_strdup ("circles");
+ }
+ theme_dir = ve_config_get_string (config, GDM_KEY_GRAPHICAL_THEME_DIR);
+ if (theme_dir == NULL ||
+ ! g_file_test (theme_dir, G_FILE_TEST_IS_DIR)) {
+ g_free (theme_dir);
+ theme_dir = g_strdup (GREETERTHEMEDIR);
+ }
+
+ /* 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 (strcmp (theme, GdmGraphicalTheme) != 0 ||
+ strcmp (theme_dir, GdmGraphicalThemeDir) != 0 ||
+ ! string_same (config,
+ GdmDefaultLocale,
+ GDM_KEY_LOCALE) ||
+ ! int_same (config,
+ GdmXineramaScreen,
+ GDM_KEY_XINERAMASCREEN) ||
+ ! bool_same (config,
+ GdmUseCirclesInEntry,
+ GDM_KEY_ENTRY_CIRCLES) ||
+ ! bool_same (config,
+ GdmShowXtermFailsafeSession,
+ GDM_KEY_SHOW_XTERM_FAILSAFE) ||
+ ! bool_same (config,
+ GdmShowGnomeFailsafeSession,
+ GDM_KEY_SHOW_GNOME_FAILSAFE) ||
+ ! bool_same (config,
+ GdmShowGnomeChooserSession,
+ GDM_KEY_SHOW_GNOME_CHOOSER) ||
+ ! string_same (config,
+ GdmSessionDir,
+ GDM_KEY_SESSDIR) ||
+ ! string_same (config,
+ GdmLocaleFile,
+ GDM_KEY_LOCFILE) ||
+ ! bool_same (config,
+ GdmSystemMenu,
+ GDM_KEY_SYSMENU) ||
+ ! string_same (config,
+ GdmHalt,
+ GDM_KEY_HALT) ||
+ ! string_same (config,
+ GdmReboot,
+ GDM_KEY_REBOOT) ||
+ ! string_same (config,
+ GdmSuspend,
+ GDM_KEY_SUSPEND) ||
+ ! string_same (config,
+ GdmConfigurator,
+ GDM_KEY_CONFIGURATOR) ||
+ ! bool_same (config,
+ GdmTimedLoginEnable,
+ GDM_KEY_TIMED_LOGIN_ENABLE) ||
+ ! int_same (config,
+ GdmTimedLoginDelay,
+ GDM_KEY_TIMED_LOGIN_DELAY)) {
+ syslog (LOG_ERR, "something not same: "
+ "theme '%s' theme_dir '%s'",
+ theme, theme_dir);
+ /* Set busy cursor */
+ setup_cursor (GDK_WATCH);
+
+ gdm_wm_save_wm_order ();
+
+ _exit (DISPLAY_RESTARTGREETER);
+ }
+
+ if ( ! bool_same (config,
+ GdmUse24Clock,
+ GDM_KEY_USE_24_CLOCK)) {
+ GdmUse24Clock = ve_config_get_bool (config,
+ GDM_KEY_USE_24_CLOCK);
+ greeter_item_clock_update ();
+ }
+
+ g_free (theme);
+ g_free (theme_dir);
+
+ return TRUE;
}
static void
@@ -776,7 +897,8 @@ greeter_done (int sig)
static char *
get_theme_file (const char *in, char **theme_dir)
{
- char *file, *dir, *info, *s, *key;
+ char *file, *dir, *info, *s;
+ VeConfig *config;
if (in == NULL)
in = "circles";
@@ -819,12 +941,9 @@ get_theme_file (const char *in, char **theme_dir)
return file;
}
- key = g_strconcat ("=", info, "=/", NULL);
- g_free (info);
- gnome_config_push_prefix (key);
- g_free (key);
+ config = ve_config_new (info);
- s = gnome_config_get_translated_string ("GdmGreeterTheme/Greeter");
+ s = ve_config_get_translated_string (config, "GdmGreeterTheme/Greeter");
if (s == NULL || s[0] == '\0')
{
g_free (s);
@@ -834,8 +953,6 @@ get_theme_file (const char *in, char **theme_dir)
file = g_build_filename (dir, s, NULL);
g_free (s);
- gnome_config_pop_prefix ();
-
return file;
}
@@ -886,7 +1003,9 @@ main (int argc, char *argv[])
greeter_session_init ();
greeter_language_init ();
- hup.sa_handler = greeter_reread_config;
+ 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);
@@ -919,7 +1038,6 @@ main (int argc, char *argv[])
ctrlch = g_io_channel_unix_new (STDIN_FILENO);
g_io_channel_set_encoding (ctrlch, NULL, NULL);
g_io_channel_set_buffered (ctrlch, FALSE);
- g_io_channel_init (ctrlch);
g_io_add_watch (ctrlch,
G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
(GIOFunc) greeter_ctrl_handler,
@@ -930,8 +1048,8 @@ main (int argc, char *argv[])
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
if (DOING_GDM_DEVELOPMENT)
- gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
- GTK_SIGNAL_FUNC (key_press_event), NULL);
+ g_signal_connect (G_OBJECT (window), "key_press_event",
+ G_CALLBACK (key_press_event), NULL);
canvas = gnome_canvas_new_aa ();
gnome_canvas_set_scroll_region (GNOME_CANVAS (canvas),
diff --git a/gui/greeter/greeter_canvas_item.c b/gui/greeter/greeter_canvas_item.c
index 3c2dc9e5..9495f89e 100644
--- a/gui/greeter/greeter_canvas_item.c
+++ b/gui/greeter/greeter_canvas_item.c
@@ -210,8 +210,8 @@ greeter_item_create_canvas_item (GreeterItemInfo *item)
item->item_type == GREETER_ITEM_TYPE_SVG ||
item->item_type == GREETER_ITEM_TYPE_PIXMAP ||
item->item_type == GREETER_ITEM_TYPE_LABEL)
- gtk_signal_connect (GTK_OBJECT (item->item), "event",
- (GtkSignalFunc) greeter_item_event_handler,
- item);
+ g_signal_connect (G_OBJECT (item->item), "event",
+ G_CALLBACK (greeter_item_event_handler),
+ item);
}
diff --git a/gui/greeter/greeter_item.c b/gui/greeter/greeter_item.c
index d91e608e..d0ccee6e 100644
--- a/gui/greeter/greeter_item.c
+++ b/gui/greeter/greeter_item.c
@@ -54,7 +54,7 @@ greeter_item_info_free (GreeterItemInfo *info)
for (i = 0; i < GREETER_ITEM_STATE_MAX; i++)
if (info->pixbufs[i])
- gdk_pixbuf_unref (info->pixbufs[i]);
+ g_object_unref (G_OBJECT (info->pixbufs[i]));
g_free (info->id);
g_free (info->orig_text);
@@ -85,7 +85,6 @@ greeter_item_update_text (GreeterItemInfo *info)
static char *
get_clock (void)
{
- char str[256];
struct tm *the_tm;
time_t the_time;
diff --git a/gui/greeter/greeter_item_capslock.c b/gui/greeter/greeter_item_capslock.c
index 05d55ed8..b700443c 100644
--- a/gui/greeter/greeter_item_capslock.c
+++ b/gui/greeter/greeter_item_capslock.c
@@ -70,8 +70,8 @@ greeter_item_capslock_setup (GtkWidget *window)
{
capslock_update (is_caps_lock_on ());
- gtk_signal_connect (GTK_OBJECT (window), "key_press_event",
- GTK_SIGNAL_FUNC (cl_key_press_event), NULL);
+ 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_clock.c b/gui/greeter/greeter_item_clock.c
index 1179f8e1..6f4874f9 100644
--- a/gui/greeter/greeter_item_clock.c
+++ b/gui/greeter/greeter_item_clock.c
@@ -4,8 +4,9 @@
#include "greeter_parser.h"
static gboolean
-update_clock (GreeterItemInfo *info)
+update_clock (gpointer data)
{
+ GreeterItemInfo *info = data;
struct tm *the_tm;
time_t the_time;
gint time_til_next_min;
@@ -18,7 +19,7 @@ update_clock (GreeterItemInfo *info)
time_til_next_min = 60 - the_tm->tm_sec;
time_til_next_min = (time_til_next_min>=0?time_til_next_min:0);
- gtk_timeout_add (time_til_next_min*1000, (GtkFunction)update_clock, info);
+ g_timeout_add (time_til_next_min*1000, update_clock, info);
return FALSE;
}
@@ -35,3 +36,13 @@ greeter_item_clock_setup (void)
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
index 744b93a0..c3d1523e 100644
--- a/gui/greeter/greeter_item_clock.h
+++ b/gui/greeter/greeter_item_clock.h
@@ -4,5 +4,6 @@
#include "greeter_item.h"
gboolean greeter_item_clock_setup (void);
+void greeter_item_clock_update (void);
#endif
diff --git a/gui/greeter/greeter_item_pam.c b/gui/greeter/greeter_item_pam.c
index d5f89677..b58f3ff8 100644
--- a/gui/greeter/greeter_item_pam.c
+++ b/gui/greeter/greeter_item_pam.c
@@ -3,6 +3,7 @@
#include "greeter_item_pam.h"
#include "greeter_parser.h"
#include "gdm.h"
+#include "gdmwm.h"
#include "vicious.h"
#include <string.h>