[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    RE: Desktop Slideshow Settings
From:       Steven Sroka <steven.sroka () live ! ca>
Date:       2010-12-06 5:42:01
Message-ID: BLU146-W2104B4861B46B0206CC77F952B0 () phx ! gbl
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Sunday, December 5, 2010, Steven Sroka wrote:
> I'm assuming the settingsChanged() signal is emitted twice, once by 'Apply'
> and once by 'OK'. Is there anyway to stop the signal from emitting from
> the 'OK' button if the settings aren't changed (because the 'Apply' button
> has already emitted the signal and done all the necessary work)?
 
yes. and now that i understand what you are trying to accomplish ... :)
 
the problem is in BackgroundDialog::saveConfig in 
kdebase/workspace/libs/plasmagenericshell/backgrounddialog.cpp
 
it is called when apply or ok is clicked and it unconditionally resets the 
wallpaper. it probably needs to track when the wallpaper settings actually 
change. right now it does this:
 
connect(wallpaperWidget, SIGNAL(modified(bool)), this, 
SLOT(settingsModified(bool)));
 
settingsModified is a generic "something's changed" handler; a new slot could 
be added that calls settingsModified, but which also tracks that value for the 
wallpaper itself and if no changes have been made to the wallpaper config, 
just not reset it.
-------------------------------------------------------------------------------------------------------------------------------I \
see, now I know what to look for.I noticed that BackgroundDialog keeps track if there \
are changes made through BackgroundDialog::hasChanged()Would it be possible to add at \
the very beginning of BackgroundDialog::saveConfig(),if( !hasChanged() ) { \
return;}orif( hasChanged() ) { //the existing code that is run when a setting is \
changed.} 		 	   		  


[Attachment #5 (text/html)]

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
<pre><font class="Apple-style-span" size="2" face="Tahoma">On Sunday, December 5, \
2010, Steven Sroka wrote:<br>&gt; I'm assuming the settingsChanged() signal is \
emitted twice, once by 'Apply'<br>&gt; and once by 'OK'. Is there anyway to stop the \
signal from emitting from<br>&gt; the 'OK' button if the settings aren't changed \
(because the 'Apply' button<br>&gt; has already emitted the signal and done all the \
necessary work)?<br> <br>yes. and now that i understand what you are trying to \
accomplish ... :)<br> <br>the problem is in BackgroundDialog::saveConfig in \
<br>kdebase/workspace/libs/plasmagenericshell/backgrounddialog.cpp<br> <br>it is \
called when apply or ok is clicked and it unconditionally resets the <br>wallpaper. \
it probably needs to track when the wallpaper settings actually <br>change. right now \
it does this:<br> <br>connect(wallpaperWidget, SIGNAL(modified(bool)), this, \
<br>SLOT(settingsModified(bool)));<br> <br>settingsModified is a generic "something's \
changed" handler; a new slot could <br>be added that calls settingsModified, but \
which also tracks that value for the <br>wallpaper itself and if no changes have been \
made to the wallpaper config, <br>just not reset it.<br></font></pre><pre><font \
class="Apple-style-span" size="2" \
face="Tahoma">-------------------------------------------------------------------------------------------------------------------------------</font></pre><pre><font \
class="Apple-style-span" size="2" face="Tahoma">I see, now I know what to look \
for.</font></pre><pre><font class="Apple-style-span" size="2" face="Tahoma">I noticed \
that BackgroundDialog keeps track if there are changes made through \
BackgroundDialog::hasChanged()</font></pre><pre><font class="Apple-style-span" \
size="2" face="Tahoma">Would it be possible to add at the very beginning of \
BackgroundDialog::saveConfig(),</font></pre><pre><font class="Apple-style-span" \
size="2" face="Tahoma"></font><span class="Apple-style-span" style="font-family: \
Tahoma; font-size: 10pt; ">if( !hasChanged() ) {</span></pre><pre><span \
class="Apple-style-span" style="font-family: Tahoma; font-size: 10pt; "> \
return;</span></pre><pre><span class="Apple-style-span" style="font-family: Tahoma; \
font-size: 10pt; ">}</span></pre><pre><span class="Apple-style-span" \
style="font-family: Tahoma; font-size: 10pt; ">or</span></pre><pre><font \
class="Apple-style-span" size="2" face="Tahoma"><meta http-equiv="content-type" \
content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: \
'Times New Roman'; white-space: normal; font-size: 12pt; "><pre style="text-indent: \
0px !important; "><span class="Apple-style-span" style="text-indent: 0px !important; \
font-family: Tahoma; font-size: 10pt; ">if( hasChanged() ) {</span></pre></span><span \
class="Apple-style-span" style="font-family: 'Times New Roman'; white-space: normal; \
font-size: 12pt; "><pre style="text-indent: 0px !important; "><span \
class="Apple-style-span" style="text-indent: 0px !important; font-family: Tahoma; \
font-size: 10pt; "> //the existing code that is run when a setting is \
changed.</span></pre></span><span class="Apple-style-span" style="font-family: 'Times \
New Roman'; white-space: normal; font-size: 12pt; "><pre style="text-indent: 0px \
!important; "><span class="Apple-style-span" style="text-indent: 0px !important; \
font-family: Tahoma; font-size: 10pt; ">}</span></pre></span></font></pre> 		 	   		  \
</body> </html>



_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic