![]() Registered Member ![]()
|
how can I apply changes for kdeglobals config without restarting session?
I know there are reparseConfiguration method callable via d-bus, but to what app? |
![]() Administrator ![]()
|
Please see KGlobalSettings.
You want to do something similar to this:
It will need two arguments - which are documented on api.kde.org.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I haven't service org.kde.KGlobalSettings: https://photos-1.dropbox.com/psi/tbd/zR ... e=1024x768 Is it available only from KDE apps? If so, can use it without writing a C++ app (possibly pykde4) |
![]() Registered Member ![]()
|
tried to use pykde4:
from PyKDE4.kdeui import KGlobalSettings KGlobalSettings.emitChange(0,0) (previously changed color scheme in [General] of kdeglobals) out: QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. and nothing changed.... |
![]() Administrator ![]()
|
The values you need to give to emitChange() need to set depending on the type of change you are making to kdeglobals.
The org.kde.KGlobalSettings interface is a signal only interface - meaning you will not see it on D-Bus. Applications send signals (like you did using your Python code) and all KDE applications recieve them and respond appropriately. The first value should be a ChangeType, and the second value a SettingsCategory. Because they are Enums, assume they begin counting at 0, and count up from there.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I changed the color scheme in kdeglobals.
then I tried to call
and
and
....still no effect. But I really changed the scheme: ![]() (as you can see apply button inactive ("Применить") and Systemsettings thinks that theme has changed but it hasn't! Also IconChanged and StyleChanged worked for me when I changed icons and windows styles manually, but I can't change palette... what I should call? p.s. I saw your name in sources of systemsettings, hope you can help me... systemsettings works good for me for changing color scheme... |
![]() Administrator ![]()
|
Unfortunately I did not develop most of the options you see within System Settings. They are plugins which have been written by others which System Settings loads in when you access them.
As for Palette/Colour changes, the following type is appropriate: KGlobalSettings::PaletteChanged. Have you updated both the style file on disk as well as all the values in kdeglobals?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I found my mistake: there are not only info about name of scheme in kdeglobals, but color info too.
OK, then next question..... how to set color scheme using KDE API? is the only way is to mix color scheme file and kdeglobals manually? |
![]() Administrator ![]()
|
Unfortunately this is the part I never 100% understood in the colour management code. My guess would be that the details in kdeglobals are either the overridden colours, or a cache for applications to be able to conveniently access. In either case, updating both is recommended.
You should be able to use kwriteconfig as a command line tool, or KConfig / KConfigGroup in a actual application to update their values (you will have to do it all by hand however).
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
solved by this function:
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]