gtranslator r3461 - in branches/GOBJECT_WORK: . src



Author: sdeburca
Date: Sat Jan 26 20:43:41 2008
New Revision: 3461
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3461&view=rev

Log:
2008-01-26  SeÃn de BÃrca  <sdeburca svn gnome org>

    * src/application.c:
    * src/main.c:
    * configure.ac:
        Remove dependencies on libgnome and libgnomeui, by Ignacio Casal
        Quinteiro and myself.


Modified:
   branches/GOBJECT_WORK/ChangeLog
   branches/GOBJECT_WORK/configure.ac
   branches/GOBJECT_WORK/src/application.c
   branches/GOBJECT_WORK/src/main.c

Modified: branches/GOBJECT_WORK/configure.ac
==============================================================================
--- branches/GOBJECT_WORK/configure.ac	(original)
+++ branches/GOBJECT_WORK/configure.ac	Sat Jan 26 20:43:41 2008
@@ -71,8 +71,6 @@
 dnl ==========================================================================
 
 GTK_REQUIRED=2.11.6
-LIBGNOME_REQUIRED=1.105.0
-LIBGNOMEUI_REQUIRED=1.105.0
 GNOME_VFS_REQUIRED=1.9.4
 LIBXML_REQUIRED=2.4.12
 LIBGLADE_REQUIRED=2.6.0
@@ -82,8 +80,6 @@
 GTKSPELL_OPTIONAL=2.0.2
 
 AC_SUBST(GTK_REQUIRED)
-AC_SUBST(LIBGNOME_REQUIRED)
-AC_SUBST(LIBGNOMEUI_REQUIRED)
 AC_SUBST(GNOME_BUILD_REQUIRED)
 AC_SUBST(GNOME_VFS_REQUIRED)
 AC_SUBST(LIBXML_REQUIRED)
@@ -93,8 +89,6 @@
 AC_SUBST(GTKSPELL_OPTIONAL)
 
 PKG_CHECK_MODULES(GTRANSLATOR, [
-libgnome-2.0 >= $LIBGNOME_REQUIRED 
-libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED 
 gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED 
 libxml-2.0 >= $LIBXML_REQUIRED 
 libglade-2.0 >= $LIBGLADE_REQUIRED

Modified: branches/GOBJECT_WORK/src/application.c
==============================================================================
--- branches/GOBJECT_WORK/src/application.c	(original)
+++ branches/GOBJECT_WORK/src/application.c	Sat Jan 26 20:43:41 2008
@@ -28,9 +28,6 @@
 #include <glib-object.h>
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
-#include <libgnomeui/gnome-client.h>
-
-
 
 #define GTR_APPLICATION_GET_PRIVATE(object)	(G_TYPE_INSTANCE_GET_PRIVATE ( \
 					 (object),	\
@@ -48,97 +45,7 @@
 	EggToolbarsModel *toolbars_model;
 };
 
-/*
- * Quits via the normal quit.
- */
-static void
-gtranslator_session_die(GnomeClient * client,
-			GtranslatorApplication *app)
-{
-	gtranslator_application_shutdown(app);
-}
-
-/*
- * Saves the state of gtranslator before quitting.
- */
-static gint
-gtranslator_session_sleep(GnomeClient * client, gint phase,
-			  GnomeSaveStyle s_style, gint shutdown,
-			  GnomeInteractStyle i_style, gint fast,
-			  GtranslatorApplication *app)
-{
-	GtranslatorTab *tab = gtranslator_window_get_active_tab(app->priv->active_window);
-	GtranslatorPo *po = gtranslator_tab_get_po(tab);
-	
-	gchar *argv[] = {
-		"rm",
-		"-r",
-		NULL
-	};
-	
-	/*
-	 * The state (for now only the current message number) is stored
-	 *  in the preferences.
-	 */
-/*	gtranslator_config_set_int("state/message_number", 
-			     g_list_position(gtranslator_po_get_messages(po),
-					     gtranslator_po_get_current_message(po)));*/
-	
-	argv[2] = NULL;
-
-	gnome_client_set_discard_command(client, 3, argv);
-
-	//argv[0] = (gchar *) data;
-	argv[1] = gtranslator_po_get_filename(po);
-
-	gnome_client_set_restart_command(client, 2, argv);
-
-	return TRUE;
-}
-
-/*
- * Restores a previously closed session.
- */ 
-static void
-gtranslator_session_restore(GnomeClient * client,
-			    GtranslatorApplication *app)
-{
-	guint num;
-
-	/*num = gtranslator_config_get_int("state/message_number");
-
-	gtranslator_message_go_to_no(NULL, GUINT_TO_POINTER(num));
-
-	push_statusbar_data(NULL, _("Session restored successfully."));*/
-	
-}
-
-static void
-gtranslator_init_session(GtranslatorApplication *app)
-{
-	GnomeClient *client;
-	GnomeClientFlags flags;
-	
-	client = gnome_master_client();
-	
-	g_signal_connect(G_OBJECT(client), "save_yourself",
-			 G_CALLBACK(gtranslator_session_sleep),
-			 app);
-	g_signal_connect(G_OBJECT(client), "die",
-			 G_CALLBACK(gtranslator_session_die), app);
-	
-	flags = gnome_client_get_flags(client);
-	if(flags & GNOME_CLIENT_RESTORED)
-	{
-//		gtranslator_session_restore(client);
-	}
-}
-
-
 
-/***************
- FIXME: This should be improved
-***************/
 static gboolean
 on_window_delete_event_cb(GtranslatorWindow *window,
 			  GdkEvent *event,
@@ -165,9 +72,7 @@
 	priv = application->priv;
 	
 	priv->windows = NULL;
-	
-	gtranslator_init_session(application);
-	
+
 	priv->toolbars_model = egg_toolbars_model_new ();
 
 	priv->toolbars_file = g_strdup_printf(

Modified: branches/GOBJECT_WORK/src/main.c
==============================================================================
--- branches/GOBJECT_WORK/src/main.c	(original)
+++ branches/GOBJECT_WORK/src/main.c	Sat Jan 26 20:43:41 2008
@@ -24,7 +24,6 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <gnome.h>
 
 #include "application.h"
 #include "prefs-manager-app.h"
@@ -32,8 +31,7 @@
 
 #include <locale.h>
 #include <glib.h>
-
-#include <libgnome/gnome-program.h>
+#include <glib/gi18n.h>
 
 #include <gconf/gconf.h>
 
@@ -45,7 +43,6 @@
      gchar *argv[])
 {
 	GError *error = NULL;
-	GnomeProgram *program;
 	GtranslatorPluginsEngine *engine;
 	
 	/*
@@ -73,13 +70,7 @@
 		g_clear_error(&error);
 	}
 
-	/*
-	 * Initialize gtranslator within libgnomeui.
-	 */
-	program = gnome_program_init(PACKAGE, VERSION, LIBGNOMEUI_MODULE, 
-				     argc, argv,
-				     GNOME_PROGRAM_STANDARD_PROPERTIES,
-				     NULL);
+	gtk_init(&argc, &argv);
 
 	/*
 	 * Show the application window with icon.
@@ -113,8 +104,6 @@
 	gtk_main();
 	
 	gtranslator_prefs_manager_app_shutdown();
-	
-	g_object_unref(program);
-	
+
 	return 0;
 }



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