#include "mainwindow.h"
#include "message_search.h"
#include "managesieve.h"
+#include "sieve_manager.h"
#include "sieve_editor.h"
GSList *editors = NULL;
void sieve_editors_close()
{
if (editors) {
- g_slist_free_full(editors, (GDestroyNotify)sieve_editor_close);
+ GSList *list = editors;
editors = NULL;
+ g_slist_free_full(list, (GDestroyNotify)sieve_editor_close);
}
}
}
static void sieve_editor_append_status(SieveEditorPage *page,
- const gchar *status)
+ const gchar *new_status)
{
GtkLabel *label = GTK_LABEL(page->status_text);
const gchar *prev_status = gtk_label_get_text(label);
const gchar *sep = prev_status && prev_status[0] ? "\n" : "";
- gtk_label_set_text(label, g_strconcat(prev_status, sep, status, NULL));
+ gchar *status = g_strconcat(prev_status, sep, new_status, NULL);
+ gtk_label_set_text(label, status);
+ g_free(status);
}
/* Update the status icon and text from a response. */
if (result->code == SIEVE_CODE_NONE) {
result->description = _("Script saved successfully.");
}
+
+ if (page->is_new) {
+ /* notify manager windows of newly created script */
+ page->is_new = FALSE;
+ sieve_manager_script_created(session,
+ page->script_name);
+ }
}
sieve_editor_update_status(page, result);
}