Mail Archives: geda-user/2019/09/02/10:49:09
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--8323329-2003997736-1567434444=:1424
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8BIT
On Mon, 2 Sep 2019, Majenko Technologies (matt AT majenko DOT co DOT uk) [via
geda-user AT delorie DOT com] wrote:
> For saving I simply iterate over any open windows (not sure if that's
> really needed?)
It is.
> and then callĀ gschem_action_activate (action_file_save_all, item); on
> that window.
That's in principle the right thing to do. The problem is that "Save all"
doesn't do the right thing--saving each modified page, asking for a
filename if necessary--but calls s_page_save_all which doesn't do any user
interaction.
That's where the spurious "untitled_1.sch" files come from. To be more
precise, it's a combination of three kinds of undesireable behavior:
- If gschem has been invoked without specifying file names on the command
line, or all pages have been closed at some point (including reverting a
single open page, as you pointed out), an untitled page is created. This
page is still present in the background after other files have been
opened.
- "Save all" doesn't care if a page has been changed; it simply saved all
pages to their internally assigned filename.
- For unsaved buffers, "Save all" doesn't ask for a filename like "Save"
does but simply uses the auto-generated "untitled_1.sch" filename.
> [Reverting is] made even more complex by the fact that you can't modify
> the GList of pages whilst iterating that GList of pages - so I just dump
> the page pointers into a temporary array first and work from that
> instead. It seems to work.
In what kind of situation would you use a "Revert all" action?
--8323329-2003997736-1567434444=:1424--
- Raw text -