anjuta r4866 - in trunk: . libanjuta plugins/sourceview po src



Author: jhs
Date: Mon Mar 16 23:06:24 2009
New Revision: 4866
URL: http://svn.gnome.org/viewvc/anjuta?rev=4866&view=rev

Log:
2009-03-16  Johannes Schmid  <jhs gnome org>

	* NEWS: Update for release
	* configure.in: Bumped to 2.26.0

2009-03-15  Johannes Schmid <jhs gnome org>

	* libanjuta/anjuta-shell.c (anjuta_shell_saving_push),
	(anjuta_shell_saving_pop):
	* libanjuta/anjuta-shell.h:
	* src/anjuta-app.c (anjuta_app_instance_init),
	(anjuta_app_saving_push), (anjuta_app_saving_pop),
	(anjuta_shell_iface_init):
	* src/anjuta-app.h:
	* src/anjuta.c (on_anjuta_delete_event):
	Implemented infrastructure to wait for all async save operation before 
	exiting

	* src/main.c (main):
	Fix trivial warning (error->message instead of error)

	* plugins/sourceview/sourceview-io.c (on_save_finished),
	(sourceview_io_save_as):
	Use saving infrastructure to fix #574376 â Save doesn't always save. Use
	g_file_replace_contents_async instead of GOutputStream to avoid duplicated
	code with gio.

Modified:
   trunk/NEWS
   trunk/configure.in
   trunk/libanjuta/anjuta-shell.c
   trunk/libanjuta/anjuta-shell.h
   trunk/plugins/sourceview/sourceview-io.c
   trunk/po/ChangeLog
   trunk/src/anjuta-app.c
   trunk/src/anjuta-app.h
   trunk/src/anjuta.c
   trunk/src/main.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Mon Mar 16 23:06:24 2009
@@ -1,3 +1,24 @@
+Anjuta 2.26.0 (16 March 2009) -- Johannes Schmid
+
+Bugs fixed:
+#397883 â The license info is almost empty
+#574376 â Save doesn't always save
+#573858 â link fail on Solaris for plugin symbol-db
+#562113 â Clean docbook syntax in order to validate
+#571740 â Get rid of deprecated libgnomecanvas
+- Fixed crash in git plugin
+- Fixed little problem in build plugin
+- Fixed distcheck
+
+- Translation updates:
+Anjuta is now fully translated into the following languages:
+pt_BR, en_GB, da, fi, fr, gl, el, it, ca, pt, sv, es, tr, hu, vi, de, sl
+and over 80% in
+ru, ja, mr, ar, th, pl
+The manual is translated into Spanish now.
+
+Thanks to all translators
+
 Anjuta 2.25.903 (2 March 2009) -- Johannes Schmid
 
 Bugs fixed:

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Mon Mar 16 23:06:24 2009
@@ -3,8 +3,8 @@
 AC_PREREQ(2.59)
 
 m4_define(anjuta_major_version,  2)
-m4_define(anjuta_minor_version, 25)
-m4_define(anjuta_micro_version,  903)
+m4_define(anjuta_minor_version, 26)
+m4_define(anjuta_micro_version,  0)
 m4_define(anjuta_nano_version, 0)
 m4_define(anjuta_version, anjuta_major_version.anjuta_minor_version.anjuta_micro_version.anjuta_nano_version)
 
@@ -34,8 +34,8 @@
 VTE_NEW_REQUIRED=0.13.1
 LIBXML_REQUIRED=2.4.23
 LIBDEVHELP_REQUIRED=0.22
-GDL_REQUIRED=0.7.3
-GLADEUI_REQUIRED=3.5.7
+GDL_REQUIRED=2.26.0
+GLADEUI_REQUIRED=3.6.0
 LIBGRAPHVIZ_REQUIRED=1.0
 NEON_REQUIRED=0.28.2
 SVN_MAJOR=1

Modified: trunk/libanjuta/anjuta-shell.c
==============================================================================
--- trunk/libanjuta/anjuta-shell.c	(original)
+++ trunk/libanjuta/anjuta-shell.c	Mon Mar 16 23:06:24 2009
@@ -754,6 +754,34 @@
 	return ANJUTA_SHELL_GET_IFACE (shell)->get_profile_manager (shell, error);
 }
 
+/**
+ * anjuta_shell_saving_push:
+ * @shell: A #AnjutaShell interface
+ *
+ * Increase the count of files that need to be saved 
+ *
+ */
+void anjuta_shell_saving_push	    (AnjutaShell* shell)
+{
+	g_return_if_fail (ANJUTA_IS_SHELL (shell));
+	
+	return ANJUTA_SHELL_GET_IFACE (shell)->saving_push (shell);
+}
+
+/**
+ * anjuta_shell_saving_push:
+ * @shell: A #AnjutaShell interface
+ *
+ * Decrease the count of files that need to be saved 
+ *
+ */
+void anjuta_shell_saving_pop	    (AnjutaShell* shell)
+{
+	g_return_if_fail (ANJUTA_IS_SHELL (shell));
+
+	return ANJUTA_SHELL_GET_IFACE (shell)->saving_pop (shell);
+}
+
 void
 anjuta_shell_session_save (AnjutaShell *shell, const gchar *session_directory,
 						   GError **error)

Modified: trunk/libanjuta/anjuta-shell.h
==============================================================================
--- trunk/libanjuta/anjuta-shell.h	(original)
+++ trunk/libanjuta/anjuta-shell.h	Mon Mar 16 23:06:24 2009
@@ -108,6 +108,8 @@
 	void (*remove_value)      (AnjutaShell  *shell,
 							   const char   *name,
 							   GError       **error);
+	void (*saving_push)       (AnjutaShell* shell);
+	void (*saving_pop)        (AnjutaShell* shell);
 	GObject* (*get_object)    (AnjutaShell  *shell,
 							   const char   *iface_name,
 							   GError       **error);
@@ -196,6 +198,9 @@
 									 AnjutaSavePrompt *prompt,
 									 GError **error);
 void anjuta_shell_notify_exit       (AnjutaShell *shell, GError **error);
+void anjuta_shell_saving_push	    (AnjutaShell* shell);
+void anjuta_shell_saving_pop	    (AnjutaShell* shell);
+
 
 /**
  * anjuta_shell_get_interface:

Modified: trunk/plugins/sourceview/sourceview-io.c
==============================================================================
--- trunk/plugins/sourceview/sourceview-io.c	(original)
+++ trunk/plugins/sourceview/sourceview-io.c	Mon Mar 16 23:06:24 2009
@@ -236,14 +236,18 @@
 }
 
 static void
-on_save_finished (GObject* output_stream, GAsyncResult* result, gpointer data)
+on_save_finished (GObject* file, GAsyncResult* result, gpointer data)
 {
 	SourceviewIO* sio = SOURCEVIEW_IO(data);
+	AnjutaShell* shell = ANJUTA_PLUGIN (sio->sv->priv->plugin)->shell;
 	GError* err = NULL;
-	g_output_stream_write_finish (G_OUTPUT_STREAM(output_stream),
-								  result,
-								  &err);
+	gchar* etag;
+	g_file_replace_contents_finish (G_FILE (file),
+	                                result,
+	                                &etag,
+	                                &err);
 	g_free (sio->write_buffer);
+	g_free (etag);
 	sio->write_buffer = NULL;
 	if (err)
 	{
@@ -253,12 +257,11 @@
 	else
 	{
 		set_display_name (sio);
-		g_output_stream_close(G_OUTPUT_STREAM (output_stream), NULL, NULL);
 		setup_monitor (sio);
 		g_signal_emit_by_name (sio, "save-finished");
 	}
-	g_object_unref (output_stream);
 	g_object_unref (sio);
+	anjuta_shell_saving_pop (shell);
 }
 
 void
@@ -279,9 +282,9 @@
 void
 sourceview_io_save_as (SourceviewIO* sio, GFile* file)
 {
-	GFileOutputStream* output_stream;
-	GError* err = NULL;
+	AnjutaShell* shell = ANJUTA_PLUGIN (sio->sv->priv->plugin)->shell;
 	gboolean backup = TRUE;
+	gsize len;
 	
 	g_return_if_fail (file != NULL);
 	
@@ -290,19 +293,11 @@
 	backup = anjuta_preferences_get_int_with_default (sio->sv->priv->prefs,
 													  "sourceview.backup", TRUE);
 	
-	output_stream = g_file_replace (file, NULL, backup, G_FILE_CREATE_NONE,
-									NULL, NULL);
-	if (!output_stream)
-	{
-		g_signal_emit_by_name (sio, "save-failed", err);
-		g_error_free (err);
-		return;
-	}
-	
 	if (sio->last_encoding == NULL)
 	{
 		sio->write_buffer = ianjuta_editor_get_text_all (IANJUTA_EDITOR(sio->sv), 
 														 NULL);
+		len = strlen (sio->write_buffer);
 	}
 	else
 	{
@@ -312,7 +307,7 @@
 		sio->write_buffer = anjuta_convert_from_utf8 (buffer_text,
 													  -1,
 													  sio->last_encoding,
-													  NULL,
+													  &len,
 													  &err);
 		g_free (buffer_text);
 		if (err != NULL)
@@ -323,13 +318,16 @@
 		}
 	}
 	g_cancellable_reset (sio->cancel);
-	g_output_stream_write_async (G_OUTPUT_STREAM (output_stream),
-								 sio->write_buffer,
-								 strlen (sio->write_buffer),
-								 G_PRIORITY_LOW,
-								 sio->cancel,
-								 on_save_finished,
-								 sio);
+	g_file_replace_contents_async (file,
+	                               sio->write_buffer,
+	                               len,
+	                               NULL,
+	                               backup,
+	                               G_FILE_CREATE_NONE,
+	                               sio->cancel,
+	                               on_save_finished,
+	                               sio);
+	anjuta_shell_saving_push (shell);
 	
 	if (sio->file != file)
 	{

Modified: trunk/src/anjuta-app.c
==============================================================================
--- trunk/src/anjuta-app.c	(original)
+++ trunk/src/anjuta-app.c	Mon Mar 16 23:06:24 2009
@@ -498,6 +498,8 @@
 	
 	/* Loading accels */
 	anjuta_ui_load_accels (NULL);
+
+	app->save_count = 0;
 }
 
 static void
@@ -768,6 +770,20 @@
 	}
 }
 
+static void
+anjuta_app_saving_push (AnjutaShell* shell)
+{
+	AnjutaApp* app = ANJUTA_APP (shell);
+	app->save_count++;
+}
+
+static void
+anjuta_app_saving_pop (AnjutaShell* shell)
+{
+	AnjutaApp* app = ANJUTA_APP (shell);
+	app->save_count--;
+}
+
 static gboolean
 remove_from_widgets_hash (gpointer name, gpointer hash_widget, gpointer widget)
 {
@@ -1041,6 +1057,8 @@
 	iface->get_preferences = anjuta_app_get_preferences;
 	iface->get_plugin_manager = anjuta_app_get_plugin_manager;
 	iface->get_profile_manager = anjuta_app_get_profile_manager;
+	iface->saving_push = anjuta_app_saving_push;
+	iface->saving_pop = anjuta_app_saving_pop;
 }
 
 ANJUTA_TYPE_BEGIN(AnjutaApp, anjuta_app, GTK_TYPE_WINDOW);

Modified: trunk/src/anjuta-app.h
==============================================================================
--- trunk/src/anjuta-app.h	(original)
+++ trunk/src/anjuta-app.h	Mon Mar 16 23:06:24 2009
@@ -58,6 +58,8 @@
 	AnjutaPreferences *preferences;
 	AnjutaPluginManager *plugin_manager;
 	AnjutaProfileManager *profile_manager;
+
+	gint save_count;
 };
 
 struct _AnjutaAppClass

Modified: trunk/src/anjuta.c
==============================================================================
--- trunk/src/anjuta.c	(original)
+++ trunk/src/anjuta.c	Mon Mar 16 23:06:24 2009
@@ -79,6 +79,15 @@
 				break;
 		}
 	}
+	/* Wait for files to be really saved (asyncronous operation) */
+	if (app->save_count > 0)
+	{
+		g_message ("Waiting for %d file(s) to be saved!", app->save_count);
+		while (app->save_count > 0)
+		{
+			g_main_context_iteration (NULL, TRUE);
+		}
+	}
 	
 	/* If current active profile is "user", save current session as
 	 * default session

Modified: trunk/src/main.c
==============================================================================
--- trunk/src/main.c	(original)
+++ trunk/src/main.c	Mon Mar 16 23:06:24 2009
@@ -184,7 +184,7 @@
 	/* Initialize gnome program */
 	if (!g_option_context_parse (context, &argc, &argv, &error))
 	{
-		DEBUG_PRINT ("Option parsing failed: %s", error);
+		DEBUG_PRINT ("Option parsing failed: %s", error->message);
 		exit(1);
 	}
 	



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