seahorse r2650 - in seahorse-plugins/trunk: . plugins/applet



Author: sadam
Date: Fri Dec 12 20:19:02 2008
New Revision: 2650
URL: http://svn.gnome.org/viewvc/seahorse?rev=2650&view=rev

Log:
2008-12-12  Adam Schreiber  <sadam clemson edu>

    * plugins/applet/seahorse-applet.c: modify main () to match 
libpanel-applet
    and no longer pull in libgnomeui.  Fixes bug #564300


Modified:
   seahorse-plugins/trunk/ChangeLog
   seahorse-plugins/trunk/plugins/applet/seahorse-applet.c

Modified: seahorse-plugins/trunk/plugins/applet/seahorse-applet.c
==============================================================================
--- seahorse-plugins/trunk/plugins/applet/seahorse-applet.c	(original)
+++ seahorse-plugins/trunk/plugins/applet/seahorse-applet.c	Fri Dec 12 20:19:02 2008
@@ -1035,17 +1035,48 @@
 int 
 main (int argc, char *argv [])
 {
+    GOptionContext *context;
+    GError *error;
+    gint retval;
+
     bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
     textdomain (GETTEXT_PACKAGE);
 
+    context = g_option_context_new ("");
+    g_option_context_add_group (context, gtk_get_option_group (TRUE));
+    g_option_context_add_group (context, bonobo_activation_get_goption_group ());
+    
+    
+
     seahorse_secure_memory_init ();
     
-    gnome_program_init ("seahorse-applet", VERSION, LIBGNOMEUI_MODULE, argc, argv,
-                        GNOME_CLIENT_PARAM_SM_CONNECT, FALSE,
-                        GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
+    error = NULL; 
+ 	if (!g_option_context_parse (context, &argc, &argv, &error)) { 
+     	if (error) { 
+         	g_printerr ("Cannot parse arguments: %s.\n", 
+         	error->message); 
+         	g_error_free (error); 
+     	} else 
+         	g_printerr ("Cannot parse arguments.\n"); 
+         	
+     	g_option_context_free (context); 
+     	
+     	return 1; 
+ 	}
     
-    return panel_applet_factory_main ("OAFIID:GNOME_SeahorseApplet_Factory", 
+    gtk_init (&argc, &argv);
+    
+    if (!bonobo_init (&argc, argv)) {
+        g_printerr ("Cannot initialize bonobo.\n");
+        return 1;
+    }
+    
+    retval =  panel_applet_factory_main ("OAFIID:GNOME_SeahorseApplet_Factory", 
                                       SEAHORSE_TYPE_APPLET, seahorse_applet_factory, NULL);
+                                      
+    g_option_context_free (context);
+    
+    return retval;
 
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]