I can alter the file to work with themes.
Or you can:
You either need a seperate set of functions to handle themes, or you need to divide preferences into two lists, one of themeable items, one of non-themeable items.
I think the seperate list is necessary in both cases.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Oh, I'v found in drThemeMenu.py. But I found if I load the aqua theme, then make it as default theme. And I remove it in preferences dialog. The icons still remain there. I found that the iconfile option still has value. If it is a bug?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'v tested my code, but cann't find error. When I choice savint theme, only style-like options are saved in theme file. Loading from theme is seem fine also. Are you sure there is some wrong?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code may be fine. As long as you can read and write themes properly, life is good.
Here is the litmus test.
Save a theme while in SDI mode.
Close DrPython
Switch to MDI mode. Save.
Now load the theme.
Back in SDI mode? Then you code is broken.
Still in MDI mode? Then life is sweet.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Does saving a theme record a non-themeable preference? I din't want to load a theme file, and
have my default find values, the location of where I locally store python docs, my default directory, etc changed!
A theme should only store how things look.
So when you say your prefsfile.py works, does it store extra info, or does it only store theme info in each theme file?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You can test like this:
saving theme to a theme file. Then open a another DrPython, save theme to an another theme file. Then diff them seeing if there are some difference.
I could not find any error. May be my steps are not like yours.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
a = default directory
b = text style
c = icon file
You want to save all three in the prefs file.
You want to save ONLY b and c in the theme file.
If the theme file contains a, b, and c, then prefsfile.py does not work right.
If the theme file contains b, and c only, life is good.
Perhaps diff ' ing a theme file and a preferences file would work. If there ARE differences, then all is well. If the two are the same, then your modifications need to be tweaked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I choice saving theme, the theme file does contains b and c, excludes a. Whether you want to say if the theme file contians all a, b and c, the prefsfile.py will still run well which should be right , otherwise there is a bug?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
so your code only saves theme stuff to the theme file? Cool beans, then it is all set. 2.4.6 should be out soon, and we can commence work on the 3.x tree.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah! For example,
('windowwidth', 'window.width', TINT, False),
the forth value indicates process with theme.
The code is:
if (not THEME and not flag) or flag:
____SetPrefProperty(prefs, pname, value, type)
flag is the forth value.
if flag is true, whatever theme is , the option always is written to theme file. -----just like iconfile and text style option.
if flag is false, as theme is false(no theme), the option will be written to general preference file; as theme is true(in theme), the option will not be written to theme preference file.
Is it all right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dan:
I'v finished my work, and send to an email. Please check it out.
It looks good, except it does not work with themes.
Once you make it work with themes, you can plop it in.
This looks MUCH better than what I had, and so long as the result plays well with the current format, all is good.
How to test with theme? Any ideas? This function I have not used yet.
I can alter the file to work with themes.
Or you can:
You either need a seperate set of functions to handle themes, or you need to divide preferences into two lists, one of themeable items, one of non-themeable items.
I think the seperate list is necessary in both cases.
I'll test is soon.
But I can not find where the variable THEME was set True. So every options were written. Even the old drPrefsFile.py does the same.
Oh, I'v found in drThemeMenu.py. But I found if I load the aqua theme, then make it as default theme. And I remove it in preferences dialog. The icons still remain there. I found that the iconfile option still has value. If it is a bug?
I'v tested my code, but cann't find error. When I choice savint theme, only style-like options are saved in theme file. Loading from theme is seem fine also. Are you sure there is some wrong?
The code may be fine. As long as you can read and write themes properly, life is good.
Here is the litmus test.
Save a theme while in SDI mode.
Close DrPython
Switch to MDI mode. Save.
Now load the theme.
Back in SDI mode? Then you code is broken.
Still in MDI mode? Then life is sweet.
Oh, poor mdi, I'll test it soon. I'v tested in mdi, not in sdi.
The point of the litmus test is:
Does saving a theme record a non-themeable preference? I din't want to load a theme file, and
have my default find values, the location of where I locally store python docs, my default directory, etc changed!
A theme should only store how things look.
So when you say your prefsfile.py works, does it store extra info, or does it only store theme info in each theme file?
You can test like this:
saving theme to a theme file. Then open a another DrPython, save theme to an another theme file. Then diff them seeing if there are some difference.
I could not find any error. May be my steps are not like yours.
No, that won't work.
Let's say you have 3 prefs:
a = default directory
b = text style
c = icon file
You want to save all three in the prefs file.
You want to save ONLY b and c in the theme file.
If the theme file contains a, b, and c, then prefsfile.py does not work right.
If the theme file contains b, and c only, life is good.
Perhaps diff ' ing a theme file and a preferences file would work. If there ARE differences, then all is well. If the two are the same, then your modifications need to be tweaked.
If I choice saving theme, the theme file does contains b and c, excludes a. Whether you want to say if the theme file contians all a, b and c, the prefsfile.py will still run well which should be right , otherwise there is a bug?
so your code only saves theme stuff to the theme file? Cool beans, then it is all set. 2.4.6 should be out soon, and we can commence work on the 3.x tree.
Yeah! For example,
('windowwidth', 'window.width', TINT, False),
the forth value indicates process with theme.
The code is:
if (not THEME and not flag) or flag:
____SetPrefProperty(prefs, pname, value, type)
flag is the forth value.
if flag is true, whatever theme is , the option always is written to theme file. -----just like iconfile and text style option.
if flag is false, as theme is false(no theme), the option will be written to general preference file; as theme is true(in theme), the option will not be written to theme preference file.
Is it all right?
Ooops. My bad, I missed that.
There must be a lesson in here somewhere.
Anyway, yes, you code is great.
Hold off a day or two, 2.4.6 is almost out, then plop that sucker in.