From: Alex de L. <ale...@us...> - 2004-03-20 18:56:48
|
Update of /cvsroot/morphix/morphixinstaller/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4077/src Modified Files: Makefile.am main.c Log Message: * added non-root dialog using libgksu Index: Makefile.am =================================================================== RCS file: /cvsroot/morphix/morphixinstaller/src/Makefile.am,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.am 14 Mar 2004 21:30:09 -0000 1.9 --- Makefile.am 20 Mar 2004 18:46:42 -0000 1.10 *************** *** 31,36 **** morphixinstallercl_LDADD = @PACKAGE_LIBS@ -lcrypt -lgthread-2.0 -lglib-2.0 $(INTLLIBS) ! morphixinstaller_LDFLAGS = -pthread ! morphixinstaller_LDADD = @PACKAGE_LIBS@ -lcrypt -lgthread-2.0 -lglib-2.0 $(INTLLIBS) --- 31,36 ---- morphixinstallercl_LDADD = @PACKAGE_LIBS@ -lcrypt -lgthread-2.0 -lglib-2.0 $(INTLLIBS) ! morphixinstaller_LDFLAGS = -pthread ! morphixinstaller_LDADD = @PACKAGE_LIBS@ -lcrypt -lgthread-2.0 -lglib-2.0 $(INTLLIBS) -lgksu Index: main.c =================================================================== RCS file: /cvsroot/morphix/morphixinstaller/src/main.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** main.c 14 Mar 2004 16:25:53 -0000 1.11 --- main.c 20 Mar 2004 18:46:42 -0000 1.12 *************** *** 66,69 **** --- 66,83 ---- } + gchar *build_cmdline(int argc, char **argv) { + int i; + if (argv == NULL || argc < 0) { + return NULL; + } + gchar *cmdline = g_strdup(argv[0]); + for (i = 1; i < argc; i++) { + gchar *tmp = g_strdup_printf("%s %s",cmdline,argv[i]); + g_free(cmdline); + cmdline = tmp; + } + return cmdline; + } + int main (int argc, char *argv[]) *************** *** 113,117 **** } else { ! ShowError(_("Sorry, you need to be root to use the Morphix installer")); } --- 127,136 ---- } else { ! gksu_init(argc,argv); ! gchar *cmdline = build_cmdline(argc,argv); ! gksu_run(cmdline); ! g_free(cmdline); ! //ShowError(_("Sorry, you need to be root to use the Morphix installer")); ! return 1; } |