kov changed gksu/branches/gksu2/ChangeLog, gksu/branches/gksu2/configure.ac, gksu/branches/gksu2/gksu/gksu.c

Gustavo Noronha kov at costa.debian.org
Wed Apr 26 02:08:14 UTC 2006


Mensagem de log: 
incorporated Startup Notification patch by Michael Vogt


-----


Modified: gksu/branches/gksu2/ChangeLog
===================================================================
--- gksu/branches/gksu2/ChangeLog	2006-04-26 01:34:14 UTC (rev 575)
+++ gksu/branches/gksu2/ChangeLog	2006-04-26 02:08:13 UTC (rev 576)
@@ -1,6 +1,9 @@
 2006-04-25  Gustavo Noronha Silva  <kov at debian.org>
 
 	* gksu/gksu.c:
+	- incorporated Startup Notification patch by Michael Vogt
+
+	* gksu/gksu.c:
 	- removed the desktop file option; will be replaced by an
 	  option to tell gksu a 'user-friendly' name for the
 	  action that is being taken

Modified: gksu/branches/gksu2/configure.ac
===================================================================
--- gksu/branches/gksu2/configure.ac	2006-04-26 01:34:14 UTC (rev 575)
+++ gksu/branches/gksu2/configure.ac	2006-04-26 02:08:13 UTC (rev 576)
@@ -42,7 +42,7 @@
 AC_PATH_PROG(GCONFTOOL, gconftool-2)
 AM_GCONF_SOURCE_2
 
-PKG_CHECK_MODULES(GKSU, [libgksu2, gtk+-2.0 >= 2.4.0])
+PKG_CHECK_MODULES(GKSU, [libgksu2, gtk+-2.0 >= 2.4.0, libstartup-notification-1.0])
 
 gtk_doc_min_version=1.0
 AC_MSG_CHECKING([gtk-doc version >= $gtk_doc_min_version])

Modified: gksu/branches/gksu2/gksu/gksu.c
===================================================================
--- gksu/branches/gksu2/gksu/gksu.c	2006-04-26 01:34:14 UTC (rev 575)
+++ gksu/branches/gksu2/gksu/gksu.c	2006-04-26 02:08:13 UTC (rev 576)
@@ -14,6 +14,9 @@
 #include <X11/Xlib.h>
 #include <gtk/gtk.h>
 
+#define SN_API_NOT_YET_FROZEN
+#include <libsn/sn.h>
+
 #include <libgksu.h>
 
 #include "defines.h"
@@ -96,7 +99,7 @@
        "    default.\n"),
     N_("  --user <user>, -u <user>\n"
        "    Call <command> as the specified user.\n"),
-       "\n"),
+    N_("\n"),
     N_("  --preserve-env, -k\n"
        "    Preserve the current environments, does not set $HOME\n"
        "    nor $PATH, for example.\n"),
@@ -156,6 +159,7 @@
 main (int argc, char **argv)
 {
   GksuContext *context;
+  SnDisplay *sn_display;
 
   GError *error = NULL;
 
@@ -348,7 +352,23 @@
     g_free (command);
   }
 
+  sn_display = sn_display_new (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
+			       NULL, NULL);
+  context->sn_context = sn_launcher_context_new (sn_display, gdk_screen_get_number (gdk_display_get_default_screen (gdk_display_get_default ())));
+  sn_launcher_context_set_description (context->sn_context, _("Grant Rights"));
+  sn_launcher_context_set_name (context->sn_context, g_get_prgname ());
+  sn_launcher_context_set_binary_name (context->sn_context,
+				       gksu_context_get_command (context));
+
   {
+    guint32 launch_time = gdk_x11_display_get_user_time((GdkDisplay*)GDK_DISPLAY());
+    sn_launcher_context_initiate (context->sn_context,
+				  g_get_prgname (),
+				  gksu_context_get_command (context),
+				  launch_time);
+  }
+
+  {
     struct passwd *pwentry;
 
     pwentry = getpwnam (gksu_context_get_user (context));
@@ -361,8 +381,12 @@
       }
 
     if (pwentry->pw_uid == geteuid ())
-      return g_spawn_command_line_sync (gksu_context_get_command (context),
-					NULL, NULL, NULL, NULL);
+      {
+	gint retval = g_spawn_command_line_sync (gksu_context_get_command (context),
+						 NULL, NULL, NULL, NULL);
+	sn_launcher_context_complete(context->sn_context);
+	return retval;
+      }
   }
 
 
@@ -383,6 +407,8 @@
 		   NULL, NULL,
 		   &error);
 
+  sn_launcher_context_complete(context->sn_context);
+
   if (error)
     {
       gk_dialog (GTK_MESSAGE_ERROR,




More information about the gksu-commits mailing list