Commit ea11eec3 authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid

Update for release Bumped to 2.26.0

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.

svn path=/trunk/; revision=4866
parent f8ce8999
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:
......
......@@ -3,8 +3,8 @@ dnl Process this file with autoconf to produce a configure script.
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_REQUIRED=0.9.0
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
......
......@@ -754,6 +754,34 @@ anjuta_shell_get_profile_manager (AnjutaShell *shell, GError **error)
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)
......
......@@ -108,6 +108,8 @@ struct _AnjutaShellIface {
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 @@ void anjuta_shell_save_prompt (AnjutaShell *shell,
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:
......
......@@ -236,14 +236,18 @@ set_display_name (SourceviewIO* sio)
}
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 @@ on_save_finished (GObject* output_stream, GAsyncResult* result, gpointer data)
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 @@ sourceview_io_save (SourceviewIO* sio)
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 @@ sourceview_io_save_as (SourceviewIO* sio, GFile* file)
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 @@ sourceview_io_save_as (SourceviewIO* sio, GFile* file)
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 @@ sourceview_io_save_as (SourceviewIO* sio, GFile* file)
}
}
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)
{
......
2009-03-16 Johannes Schmid <jhs@gnome.org>
* de.po: Translated the last 8 strings into German
2009-03-16 Petr Kovar <pknbe@volny.cz>
* cs.po: Updated Czech translation by Lucas Lommer.
......
......@@ -498,6 +498,8 @@ anjuta_app_instance_init (AnjutaApp *app)
/* Loading accels */
anjuta_ui_load_accels (NULL);
app->save_count = 0;
}
static void
......@@ -768,6 +770,20 @@ anjuta_app_remove_value (AnjutaShell *shell, const char *name, GError **error)
}
}
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 @@ anjuta_shell_iface_init (AnjutaShellIface *iface)
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);
......
......@@ -58,6 +58,8 @@ struct _AnjutaApp
AnjutaPreferences *preferences;
AnjutaPluginManager *plugin_manager;
AnjutaProfileManager *profile_manager;
gint save_count;
};
struct _AnjutaAppClass
......
......@@ -79,6 +79,15 @@ on_anjuta_delete_event (AnjutaApp *app, GdkEvent *event, gpointer data)
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
......
......@@ -184,7 +184,7 @@ main (int argc, char *argv[])
/* 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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment