![]() Registered Member ![]()
|
hi! i'm writing my first plasmoid. it's an alternative shutdown plasmoid.
My problem is that i can't figure out how config works. i'm trying to using it copying from another plasmoid. when i click on the "OK" button in the configuration interface of the plasmoid it should store the config, but it doesn't. there's the code. i highlighted the probably wrong lines with "!!!!" i'm sorry for the confused code, i'll rewrite it once end ...and sorry for my english main.py
Appearance.py
AppearanceUi.py
Last edited by ophys on Tue Jun 15, 2010 12:37 pm, edited 2 times in total.
|
![]() KDE Developer ![]()
|
It doesn't write the config in a sense that you don't see it in the config file, or in a sense that the next time you call readEntry(...) you get the old value?
If it is the former, it just means that config hasn't synced yet. If you want to sync it manually, call conf.sync() (though, I'm not sure it is available via Python bindings) |
![]() Registered Member ![]()
|
in the config file i see always the same value
whatever i click on the checkbox or not the value is always true. i don't know why.. |
![]() Administrator ![]()
|
Just wondering, why are you creating the configuration dialog yourself?
http://purinchu.net/kdelibs-apidocs/pla ... 67d6781669
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
I don't know... I'm copying from another plasmoid
![]() could it cause the problem? when the plasmoid will be ready i'll edit it according to the standards |
![]() KDE Developer ![]()
|
You didn't really answer my question - are you checking the value only via the config file or readEntry() returns the old value?
p.s. Fixed typos in the title |
![]() Registered Member ![]()
|
I simply open the config file with kate, and as I said it's always the same value. So also readEntry returns always the same value. i think the error is in the writing process of the entry. |
![]() KDE Developer ![]()
|
> so also readEntry returns always the same value.
This is not a conclusion you can make - KConfig caches values and doesn't automatically save them to the disk - that is why I asked the question in the first place. You should put some debugging code before writeEntry - to see whether it is being invoked at all. |
![]() Registered Member ![]()
|
i think you're right.Maybe the problem is this:
it returns always true, whatever i click on the checkbox or not. ( I thought I didn't use writeEntry in the right way) you can notice it
it always start konsole. but why it's always true? miss the code some Qt signal to work? that the entire main.py.
|
![]() Registered Member ![]()
|
resolved
I delete createConfigurationInterface() function and modified showConfigurationInterface
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]