After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 531070 - adding themes from an xml file
adding themes from an xml file
Status: RESOLVED FIXED
Product: libgoffice
Classification: Other
Component: Graphing / Charting
0.6.x
Other All
: Normal enhancement
: ---
Assigned To: Jean Bréfort
Jody Goldberg
: 625880 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-05-02 14:36 UTC by Naud
Modified: 2010-08-12 09:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
What the default theme might look like as an xml file. (6.91 KB, application/xml)
2008-07-24 15:02 UTC, Jean Bréfort
  Details
Preliminary patch (7.43 KB, patch)
2010-08-05 21:01 UTC, Jean Bréfort
none Details | Review
Updated patch (11.62 KB, patch)
2010-08-08 19:40 UTC, Jean Bréfort
none Details | Review
Hopefully final patch (20.09 KB, patch)
2010-08-10 15:54 UTC, Jean Bréfort
none Details | Review

Description Naud 2008-05-02 14:36:56 UTC
Would it be possible to implement new themes into gnumeric via xml files ?
It could really ease and even allow a theme-database, kind of templates... Would be great !
Comment 1 Jean Bréfort 2008-07-15 09:46:58 UTC
There are several steps necessary to fulfill this goal:
- devise a dtd or XMLSchema to describe the fi le structure.
- replace map_area_series_solid_* by something which might be dynamically overriden.
- implement theme loading.
Comment 2 Jean Bréfort 2008-07-24 15:02:57 UTC
Created attachment 115175 [details]
What the default theme might look like as an xml file.

Waiting for comments...
Btw, may be the default theme should remain hardcoded.
Comment 3 Jean Bréfort 2008-07-25 15:08:25 UTC
I'm not sure that themes as xml files are a fantastic idea. What will happen if a file is created using a theme and then opened on a machine lacking the theme?
Comment 4 Emmanuel Pacaud 2008-07-25 15:39:06 UTC
>> What will happen if a file is created using a theme and then opened
>> on a machine lacking the theme?

I guess we'll have to save the theme data in each file.

Regarding the theme file itself, I'm not sure the current way we set object attributes is good. It would probably a good idea to have something similar to CSS (which could be expressed as xml). That would ease the writing of themes.
Comment 5 Jean Bréfort 2008-10-14 06:15:38 UTC
The issue I find with CSS is that it lacks the concept of a palette.

Saving the theme with each file is not trivial either. We might end saving the theme whith each graph. Looks like all this needs more thinking.
Comment 6 Jean Bréfort 2010-04-02 14:04:06 UTC
Themes can be saved at the GODoc level. Just if we use CSS, we'll probably heve to use libcroco.
Comment 7 Jean Bréfort 2010-04-09 14:26:56 UTC
CSS is not appropriate in the end. If we had to use some existing syntax we should better use SVG styles. Anyway, a theme is merely a collection of styles, and we already have an XML syntax for styles, so I'll do it this way.
Comment 8 Jean Bréfort 2010-08-03 06:07:15 UTC
*** Bug 625880 has been marked as a duplicate of this bug. ***
Comment 9 Jean Bréfort 2010-08-05 21:01:14 UTC
Created attachment 167217 [details] [review]
Preliminary patch

Unfortunately, this does not fix everything. Known issues are (I might miss some at the moment):

- themes would appear as plugins (but have no library, just an xml file) and can't be activated/dectivated properly;

- used themes are not saved with the document, I'm not sure about what should be done, a local theme might have the same name than a saved theme, but be actually be different, which might lead to inconsistensies, and on the other side, if the theme is not saved, we will fall back to the default theme each time locally unknown theme is referenced in a file;

- an xml theme is actually a collection of styles, but not every field in the styles will be taken into account (that would need more auto flags);

- I need to write some documentation about how to build a new theme while I still remember how things work.
Comment 10 Jean Bréfort 2010-08-08 19:40:48 UTC
Created attachment 167376 [details] [review]
Updated patch

With this patch, themes don't appear as plugins.
Comment 11 Jean Bréfort 2010-08-10 15:54:20 UTC
Created attachment 167526 [details] [review]
Hopefully final patch
Comment 12 Jean Bréfort 2010-08-10 15:57:49 UTC
I still need to add some documentation.
Comment 13 Jean Bréfort 2010-08-12 09:13:05 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.

Fixed using a slightly modified patch, with some inline documentation.