{
CollectTable *ct = data;
+ /* If there is no unsaved data, save the window geometry
+ */
+ if (!ct->cd->changed)
+ {
+ if (!collection_save(ct->cd, ct->cd->path))
+ {
+ log_printf("failed saving to collection path: %s\n", ct->cd->path);
+ }
+ }
+
if (ct->popup)
{
g_signal_handlers_disconnect_matched(G_OBJECT(ct->popup), G_SIGNAL_MATCH_DATA,
if (cw) collection_window_close_final(cw);
}
+/**
+ * @brief Check if any Collection windows have unsaved data
+ * @returns TRUE if unsaved data exists
+ *
+ * Also saves window geometry for Collection windows that have
+ * no unsaved data
+ */
gboolean collection_window_modified_exists(void)
{
GList *work;
+ gboolean ret;
+
+ ret = FALSE;
work = collection_window_list;
while (work)
{
CollectWindow *cw = work->data;
- if (cw->cd->changed) return TRUE;
+ if (cw->cd->changed)
+ {
+ ret = TRUE;
+ }
+ else
+ {
+ if (!collection_save(cw->table->cd, cw->table->cd->path))
+ {
+ log_printf("failed saving to collection path: %s\n", cw->table->cd->path);
+ }
+ }
work = work->next;
}
- return FALSE;
+ return ret;
}
static gboolean collection_window_delete(GtkWidget *widget, GdkEvent *event, gpointer data)