Index: trunk/src/sch-rnd/file_act.c =================================================================== --- trunk/src/sch-rnd/file_act.c (revision 10324) +++ trunk/src/sch-rnd/file_act.c (revision 10325) @@ -54,7 +54,17 @@ #include "multi.h" #include "project.h" +/* Return 1 if any of the currently loaded sheets have changes on them */ +static int any_sheet_changed(void) +{ + csch_sheet_t *sheet; + for(sheet = gdl_first(&rnd_designs); sheet != NULL; sheet = sheet->hidlib.link.next) + if (sheet->changed) + return 1; + return 0; +} + static const char csch_acts_Quit[] = "Quit()"; static const char csch_acth_Quit[] = "Quits sch-rnd after confirming."; static fgw_error_t csch_act_Quit(fgw_arg_t *res, int argc, fgw_arg_t *argv) @@ -67,7 +77,7 @@ exit(0); TODO("need to check all sheets, not just the current one") - if (!sheet->changed || (rnd_hid_message_box(RND_ACT_DESIGN, "warning", "Close: lose data", "Exiting sch-rnd will lose unsaved sheet modifications.", "cancel", 0, "ok", 1, NULL) == 1)) + if (!any_sheet_changed() || (rnd_hid_message_box(RND_ACT_DESIGN, "warning", "Close: lose data", "Exiting sch-rnd will lose unsaved sheet modifications.", "cancel", 0, "ok", 1, NULL) == 1)) sch_rnd_quit_app(); RND_ACT_IRES(-1);