[Geany-devel] Multiple instances of Geany issues
Lex Trotman
elextr at xxxxx
Fri May 21 12:05:10 UTC 2010
On 21 May 2010 20:06, Dimitar Zhekov <hamster at mbox.contact.bg> wrote:
> On Fri, 21 May 2010 16:53:56 +1000
> Lex Trotman <elextr at gmail.com> wrote:
>
> > On 21 May 2010 15:13, Eugene Arshinov <earshinov at gmail.com> wrote:
> >
> > > But now there is a suggestion from Dimitar to also support changing
> > > preferences in secondary instances. The last solution I wrote in "the
> > > large thread" is to change automatic saving when closing. It should
> > > save only things that are not related to Preferences dialog (window
> > > position, opened files if needed etc.), and only in the main instance,
> > > of course. Changed preferences are saved immediately after applying
> > > changes user made in the Preferences dialog, either in a main instance
> > > or a secondary instance.
> > >
>
> The way it can be implemented in detail (since I fubmled with the
> respective files in the last few days):
>
> save_dialog_prefs(GKeyFile *config) becomes global
> configuration_save_dialog_prefs(void).
>
> on_prefs_button_clicked() invokes configuration_save_dialog_prefs()
> instead of configuration_save().
>
>
Yeah, save_dialog_prefs would need the parts of configuration_save() that
opens and closes the file of course :-)
> configuration_save() does not invoke save_dialog_prefs().
>
> quit_app() checks cl_options.new_instance to see if
> configuration_save() should be called.
>
> There are no other calls of configuration_save(), so that should
> suffice.
>
>
Yes.
> > >
> > Have to think carefully about which things are in which category, maybe
> it
> > could be ok, and could be applied to the project files as well. Reload
> > would be good as well so that settings can be transferred between
> instances.
>
> If this is applied to the projects, it would be something like:
>
> 1. Project -> Properties always saves the project dialog properties,
> but not the file list.
>
> Of course, as Lex wrote out, it'll have to check if the project file
> was modified, and ask to save / save as / throw away (apply without
> saving?) the changes.
>
>
I'm afraid I didn't think this through enough, any change to a setting will
update the project file and get it a new timestamp so you would be getting
the message all the time.
I guess that if we allow multiple openings of the same project (and I can't
see how we can prevent it) then when a setting is changed it will change the
project file. Its probably not really a problem, it was the race when
multiple instances closed that was the problem.
ATM the project saves the session files in the project each time a setting
is changed, that would need fixing.
As I said post 0.19 a reload dialog could be nice so instances could be
resynced.
> 2. Closing a project or quitting Geany saves only the file list, and
> only if that's a main instance.
>
Yes this will remove the race for the project file on closing multiple
instances.
>
> I rarely open a project 2+ times, so RFC how useful would that be?
>
> Well as I said its to get two windows on two screens both with the same
configuration, its not about the session files in the project but the other
config eg build.
Also I've just discovered that if I close a new_instance with files open
when the main instance has a project open, on closing the project, the main
instance's session matches the session files that were open in the
new_instance.
Clearly the main instance is re-reading the conf file and getting the
session files written by the new_instance. Saving session files only in the
main instance will fix this too.
Cheers
Lex
> --
> E-gards: Jimmy
> _______________________________________________
> Geany-devel mailing list
> Geany-devel at uvena.de
> http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20100521/bb8fbf8a/attachment.html>
More information about the Devel
mailing list