When saving on build, prompt for a filename if necessary.

Emit the "build-start" signal only if saving succeeds.



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/branches/unstable@5972 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2011-09-29 18:03:36 +00:00
parent a80bab9e3c
commit c6b38b861e
3 changed files with 16 additions and 3 deletions

View File

@ -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:

View File

@ -187,7 +187,7 @@ signal void (*project_dialog_confirmed)(GObject *obj, GtkWidget *notebook, gpoin
*/
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.

View File

@ -1272,10 +1272,16 @@ static void on_build_menu_item(GtkWidget *w, gpointer user_data)
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 */