[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-panel-devel
Subject: Re: configAccepted()
From: Toussis Manolis <manolis () koppermind ! homelinux ! org>
Date: 2009-02-23 20:18:09
Message-ID: 200902232218.09706.manolis () koppermind ! homelinux ! org
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
ignore the previous message.
On Monday 23 February 2009 22:01:06 Toussis Manolis wrote:
> I re-implementing in my applet the configAccepted() to store the
> settings...
>
> The thing is that I came across a strange issue.
> I run the applet if I invoke the config interface, and press ok...
> configAccepted is called once. Then I close the applet , and configAccepted
> is called once more. All the options are saved fine.
>
> If I run the applet and don't invoke the config interface, and the close
> the applet. configAccepted() is called only on applet close, and all the
> settings are reset, and are not saved with the current settings.
>
> Any help?
>
>
>
> Here is the code:
>
> void PlasmaTvGr::configAccepted()
> {
> kDebug()<<"run";
> if(m_dialog)
> {
> switch(ui.loopBox->currentIndex()){
> case 0:
> m_loop=0;break;
> case 1:
> m_loop=15;break;
> case 2:
> m_loop=30;break;
> case 3:
> m_loop=60;break;
> case 4:
> m_loop=600;break;
> case 5:
> m_loop=1800;break;
> default:
> m_loop=0;
> };
> m_fontSize=ui.fontBox->currentText().toInt();
> };
> m_chanList="";
> QListWidgetItem* item;
> int w1,w2;
> int shownOne=0;
> for(w1=0;w1<ui.list1->count();w1++)
> {
> item=ui.list1->item(w1);
> w2=item->isSelected();
> if(w2==1) shownOne=1;
> m_chanList.append(QString::number(w2)+",");
> };
> m_chanList.chop(1);
> if(shownOne==0) m_chanList[0]='1';
> KConfigGroup cg = config();
> cg.writeEntry("LoopSeconds", m_loop);
> cg.writeEntry("SelectedChannel", m_channelID);
> cg.writeEntry("FontSize",m_fontSize);
> cg.writeEntry("ChannelList",m_chanList);
> m_channel=chan[m_channelID];
> if(m_loop!=0) m_loopTimer->start(m_loop*1000); else m_loopTimer->stop();
> calculateSizes();
> //updateGeometry();
> m_pixmapUpdate=1;
> update();
> emit configNeedsSaving();
> };
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
"http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" \
content="1" /><style type="text/css">p, li { white-space: pre-wrap; \
}</style></head><body style=" font-family:'Arial'; font-size:11pt; font-weight:400; \
font-style:normal;">ignore the previous message. <br> <p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p \
style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; \
margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>On \
Monday 23 February 2009 22:01:06 Toussis Manolis wrote:<br> > I re-implementing in \
my applet the configAccepted() to store the<br> > settings...<br>
><br>
> The thing is that I came across a strange issue.<br>
> I run the applet if I invoke the config interface, and press ok...<br>
> configAccepted is called once. Then I close the applet , and configAccepted<br>
> is called once more. All the options are saved fine.<br>
><br>
> If I run the applet and don't invoke the config interface, and the close<br>
> the applet. configAccepted() is called only on applet close, and all the<br>
> settings are reset, and are not saved with the current settings.<br>
><br>
> Any help?<br>
><br>
><br>
><br>
> Here is the code:<br>
><br>
> void PlasmaTvGr::configAccepted()<br>
> {<br>
> kDebug()<<"run";<br>
> if(m_dialog)<br>
> {<br>
> switch(ui.loopBox->currentIndex()){<br>
> case 0:<br>
> m_loop=0;break;<br>
> case 1:<br>
> m_loop=15;break;<br>
> case 2:<br>
> m_loop=30;break;<br>
> case 3:<br>
> m_loop=60;break;<br>
> case 4:<br>
> m_loop=600;break;<br>
> case 5:<br>
> m_loop=1800;break;<br>
> default:<br>
> m_loop=0;<br>
> };<br>
> m_fontSize=ui.fontBox->currentText().toInt();<br>
> };<br>
> m_chanList="";<br>
> QListWidgetItem* item;<br>
> int w1,w2;<br>
> int shownOne=0;<br>
> for(w1=0;w1<ui.list1->count();w1++)<br>
> {<br>
> item=ui.list1->item(w1);<br>
> w2=item->isSelected();<br>
> if(w2==1) shownOne=1;<br>
> m_chanList.append(QString::number(w2)+",");<br>
> };<br>
> m_chanList.chop(1);<br>
> if(shownOne==0) m_chanList[0]='1';<br>
> KConfigGroup cg = config();<br>
> cg.writeEntry("LoopSeconds", m_loop);<br>
> cg.writeEntry("SelectedChannel", m_channelID);<br>
> cg.writeEntry("FontSize",m_fontSize);<br>
> cg.writeEntry("ChannelList",m_chanList);<br>
> m_channel=chan[m_channelID];<br>
> if(m_loop!=0) m_loopTimer->start(m_loop*1000); else \
m_loopTimer->stop();<br> > calculateSizes();<br>
> //updateGeometry();<br>
> m_pixmapUpdate=1;<br>
> update();<br>
> emit configNeedsSaving();<br>
> };<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; \
-qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px; -qt-user-state:0;"><br></p></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