? xmldocs.make
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gnome-utils/configure.in,v
retrieving revision 1.350
diff -u -r1.350 configure.in
--- configure.in	3 Jun 2004 05:54:14 -0000	1.350
+++ configure.in	16 Jul 2004 08:17:22 -0000
@@ -30,6 +30,7 @@
 LIBGNOMEUI_REQUIRED=2.5.0
 LIBGLADE_REQUIRED=2.3.0
 LIBBONOBOUI_REQUIRED=2.1.0
+LIBGNOMESU_REQUIRED=0.9.3
 GNOMEVFS_REQUIRED=2.3.0
 LIBPANEL_APPLET_REQUIRED=2.3.0
 
@@ -40,6 +41,13 @@
 PKG_CHECK_MODULES(GNOME_UTILS, gtk+-2.0 >= $GTK_REQUIRED libgnome-2.0 >= $LIBGNOME_REQUIRED libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED)
 AC_SUBST(GNOME_UTILS_CFLAGS)
 AC_SUBST(GNOME_UTILS_LIBS)
+
+dnl *****************************************
+dnl logview needs libgnomesu
+dnl *****************************************
+PKG_CHECK_MODULES(LIBGNOMESU, libgnomesu-1.0 >= $LIBGNOMESU_REQUIRED)
+AC_SUBST(LIBGNOMESU_CFLAGS)
+AC_SUBST(LIBGNOMESU_LIBS)
 
 dnl *****************************************
 dnl floppy-buddy needs libglade
Index: logview/Makefile.am
===================================================================
RCS file: /cvs/gnome/gnome-utils/logview/Makefile.am,v
retrieving revision 1.30
diff -u -r1.30 Makefile.am
--- logview/Makefile.am	20 Apr 2004 11:44:54 -0000	1.30
+++ logview/Makefile.am	16 Jul 2004 08:17:22 -0000
@@ -6,6 +6,7 @@
 additionaldir  = $(datadir)/gnome-system-log
 
 INCLUDES = -DG_LOG_DOMAIN=\"gnome-system-log\"	$(GNOME_UTILS_CFLAGS) 		\
+	$(LIBGNOMESU_CFLAGS)						\
 	-DGNOMELOCALEDIR=\""$(gnomeutilslocaledir)"\"			\
 	-DDATADIR=\""$(datadir)"\" \
 	-DLOGVIEWINSTALLPREFIX=\""$(prefix)/\""
@@ -31,7 +32,8 @@
 	zoom.c
 
 gnome_system_log_LDADD = \
-	$(GNOME_UTILS_LIBS)
+	$(GNOME_UTILS_LIBS) \
+	$(LIBGNOMESU_LIBS)
 
 man_MANS = gnome-system-log.1
 
Index: logview/logview.c
===================================================================
RCS file: /cvs/gnome/gnome-utils/logview/logview.c,v
retrieving revision 1.58
diff -u -r1.58 logview.c
--- logview/logview.c	8 May 2004 01:43:29 -0000	1.58
+++ logview/logview.c	16 Jul 2004 08:17:22 -0000
@@ -30,6 +30,7 @@
 #include <sys/stat.h>
 #include "logview.h"
 #include <libgnomeui/gnome-window-icon.h>
+#include <libgnomesu/libgnomesu.h>
 #include <ctype.h>
 
 /*
@@ -57,7 +58,7 @@
 void change_log (int dir);
 void open_databases (void);
 void destroy (void);
-void InitApp (void);
+void InitApp (char **argv);
 int InitPages (void);
 int RepaintLogInfo (void);
 int read_regexp_db (char *filename, GList **db);
@@ -326,7 +327,7 @@
    /*  Load graphics config */
    cfg = CreateConfig();
    
-   InitApp ();
+   InitApp (argv);
 
    log_repaint (); 
 
@@ -352,7 +353,7 @@
    ---------------------------------------------------------------------- */
 
 void
-InitApp ()
+InitApp (char **argv)
 {
    loginfovisible = FALSE;
    regexp_db = NULL;
@@ -366,8 +367,14 @@
    open_databases ();
 
    /*  Read files and init data. */
-   if (InitPages () < 0)
-	 ShowErrMessage (_("No log files to open"));
+   if (InitPages () < 0) {
+	 if (getuid () == 0)
+	     ShowErrMessage (_("No log files to open"));
+	 else {
+	     gnomesu_spawn_async ("root", argv, NULL);
+	     exit (0);
+	 }
+   }
 
 }
 
