On Sat, 5 Jun 2010 12:10:01 +0300% Dimitar Zhekov dimitar.zhekov@gmail.com wrote:
Hi,
- Limit Project -> Properties to saving the preferences only, and
limit project_close() to saving the file list only.
Here it is, combined with the other save-* patches. BTW, when creating a new project, it's immediately saved, both the settings and the file list. So to avoid function cloning, and since it's unclear what save behaviour will be approved, I decided to declare an enum save {dialog, non-dialog, all} and use such argument for configuration_save() and project's write_config().
I ported this patch to SM branch and will commit it soon, after I'm confident enough that I didn't break anything.
Here are some changes I made to your original patch:
* Renamed your GeanySaveSettingsType enum to GeanySettingsTypes and converted simple constants in it to flags, which is more natural.
* AFAIK in Geany doc-comments (/**) are used only for symbols exported for plugins. I modified the comment before GeanySettingsTypes accordingly.
* Created a separate GeanyProjectSettingsTypes for project.c:write_config(): with my implementation of recent file lists I have additional _RECENT_FILES and _RECENT_PROJECTS flags in GeanySettingsTypes, which are not applicable to GeanyProjectSettingsTypes
In case it's interesting for someone, I attach the combined patch, modified to apply cleanly to SM. It also includes the patch from Lex to add locking and my changes to recent files handling (probably the latter takes the largest part of the patch).
What remains:
Decide on "Save settings?" prompts, or make it an option - see below.
Decide whether to merge the recent files in geany.conf in real time, or have separate geany.conf and per-project recent file lists (since we have per-project open file lists).
On Thu, 3 Jun 2010 16:38:57 +1000 Lex Trotman elextr@gmail.com wrote:
Something like "This is a secondary instance of Geany, saving your settings will overwrite the settings from your main instance, Save/Cancel". They should still be applied locally of course, otherwise why allow the prefs dialog at all.
The more I think about that, the less I like it. Not only will be such a prompt irritating, especially for Apply, but how many times before the user chooses the wrong button and overrides the settings, or loses them after exiting geany?
Why not make it an option, default=on for compatibility, disabled for the secondary instances (since they depend on it). Personally I'll just leave it on and be done, while you will probably turn it off.