Revision: 5972 http://geany.svn.sourceforge.net/geany/?rev=5972&view=rev Author: ntrel Date: 2011-09-29 18:03:36 +0000 (Thu, 29 Sep 2011) Log Message: ----------- When saving on build, prompt for a filename if necessary. Emit the "build-start" signal only if saving succeeds.
Modified Paths: -------------- branches/unstable/ChangeLog branches/unstable/doc/pluginsignals.c branches/unstable/src/build.c
Modified: branches/unstable/ChangeLog =================================================================== --- branches/unstable/ChangeLog 2011-09-29 17:49:42 UTC (rev 5971) +++ branches/unstable/ChangeLog 2011-09-29 18:03:36 UTC (rev 5972) @@ -1,3 +1,10 @@ +2011-09-29 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/build.c, doc/pluginsignals.c: + When saving on build, prompt for a filename if necessary. + Emit the "build-start" signal only if saving succeeds. + + 2011-09-21 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* src/build.c:
Modified: branches/unstable/doc/pluginsignals.c =================================================================== --- branches/unstable/doc/pluginsignals.c 2011-09-29 17:49:42 UTC (rev 5971) +++ branches/unstable/doc/pluginsignals.c 2011-09-29 18:03:36 UTC (rev 5972) @@ -187,7 +187,7 @@ */ signal void (*geany_startup_complete)(GObject *obj, gpointer user_data);
-/** Sent before build is started. Plugins can use this signal e.g. to save the opened documents +/** Sent before build is started. A plugin could use this signal e.g. to save all unsaved documents * before the build starts. * * @param obj a GeanyObject instance, should be ignored.
Modified: branches/unstable/src/build.c =================================================================== --- branches/unstable/src/build.c 2011-09-29 17:49:42 UTC (rev 5971) +++ branches/unstable/src/build.c 2011-09-29 18:03:36 UTC (rev 5972) @@ -1272,10 +1272,16 @@ gint grp = GPOINTER_TO_GRP(user_data); gint cmd = GPOINTER_TO_CMD(user_data);
+ if (doc && doc->changed) + { + if (document_need_save_as(doc) && !dialogs_show_save_as()) + return; + + if (!document_save_file(doc, FALSE)) + return; + } g_signal_emit_by_name(geany_object, "build-start");
- if (doc && doc->changed) - document_save_file(doc, FALSE); if (grp == GEANY_GBG_NON_FT && cmd == GBO_TO_CMD(GEANY_GBO_CUSTOM)) { static GtkWidget *dialog = NULL; /* keep dialog for combo history */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.