Re: [gedit-list] Feature bounty: Support for profiles



2010/8/16 Sébastien Wilmet <sebastien wilmet gmail com>
Hello,

I also want to have Gedit profiles, and I have some ideas on how to implement it.

A profile is not just a list of which plugins to enable, but _all_ the settings, including the "common" settings like indentation style, style scheme, etc.

What we can do for creating a new profile is simply create a copy of org.gnome.gedit.gschema.xml, change its default values and install it into another name like "org.gnome.gedit-profile_name" or "org.gnome.gedit.profile_name", but the second form can have conflicts.

Then we could invoke gedit like this (an alias can be created for more convenience):
gedit --profile profile_name

It should be possible to run different instances of gedit with different profiles that are completely independent.

I have looked a little at the sources and I think it's not difficult to do.
First, a function like get_root_settings () could be created that returns the string "org.gnome.gedit" or "org.gnome.gedit-profile_name" if we are on a profile, etc.
And the other thing is to change the dbus name in gedit_dbus_run ().
I think there is nothing else to do, but I'll see tomorrow when I'll try that.

A drawback of this solution is that if the settings of Gedit change (a new setting, or a name modification, ...), the gschemas of the profiles have to be updated too.

This solution, if it works, is fine but the user can not creates its own profiles easily.
GSettingsList could be a solution for that since it could be used to store gnome-terminal profiles or telepathy accounts, according to [1].
And indeed, GSettingsList is not currently pushed on the master branch of glib, but the code is in the gsettings branch [2].


Another thing that I would like to see (and will try to do in the future) in Gedit is a libgedit, so IDEs can use it like a framework. This is not incompatible with profiles, and some developers who wants more flexibility than a Gedit plugin can create a new IDE more easily. And maybe it could be even possible to use gedit plugins in an IDE that use libgedit, since it's the same API, but it's not for tomorrow...

[1] http://www.mail-archive.com/gtk-devel-list gnome org/msg11753.html
[2] http://git.gnome.org/browse/glib/tree/gio/gsettingslist.h?h=gsettings


I reply to myself...
It's not a good solution, because all the plugins settings are not registered into the profile.
So we have to wait GSettingsList.

Sébastien


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]