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

List:       kde-panel-devel
Subject:    Re: KDE/kdebase/workspace/libs/plasma
From:       Loïc_Marteau <loic.marteau () gmail ! com>
Date:       2008-08-28 19:55:26
Message-ID: 48B702AE.4070506 () gmail ! com
[Download RAW message or body]

hi all !

in the patch i'm working (really sorry to be late, i have a big 
professional event to deal with and i'm a little stressed by this)
i have started to handle this by using a signal.    

emit popupActivate()

Kickoff need it to call reset so the last search from the user is 
reseted when kickoff is re-popuped
Perahps Davide you have add this for the same thing ?!

I will rework on the patch newt week. 

I really do not have any personal problem to remove the signal and use 
popupEvent instead.

My two only motivations is to see in general the better code possible 
implemented for plasma and be personally better in qt hacking :
It is a perhaps stupid question but is it a difference between using a 
signal or a virtual method for such case ?

Best regards

Loic



Davide Bettio wrote:
> SVN commit 854047 by bettio:
> 
> Added popupEvent.
> CCMAIL:plasma-devel@kde.org
> 
> 
> M  +9 -0      popupapplet.cpp  
> M  +6 -0      popupapplet.h  
> 
> 
> --- trunk/KDE/kdebase/workspace/libs/plasma/popupapplet.cpp #854046:854047
> @@ -243,6 +243,7 @@
> void PopupApplet::showPopup(uint popupDuration)
> {
> if (d->dialog && (formFactor() == Horizontal || formFactor() == Vertical)) {
> +        popupEvent(true);
> d->dialog->move(popupPosition(d->dialog->size()));
> d->dialog->show();
> 
> @@ -264,10 +265,16 @@
> void PopupApplet::hidePopup()
> {
> if (d->dialog && (formFactor() == Horizontal || formFactor() == Vertical)) {
> +        popupEvent(false);
> d->dialog->hide();
> }
> }
> 
> +void PopupApplet::popupEvent(bool)
> +{
> +
> +}
> +
> void PopupApplet::widgetGeometryChanged()
> {
> if (graphicsWidget() && layout()) {
> @@ -284,6 +291,8 @@
> void PopupAppletPrivate::togglePopup()
> {
> if (dialog) {
> +        q->popupEvent(!dialog->isVisible());
> +
> if (dialog->isVisible()) {
> dialog->hide();
> } else {
> --- trunk/KDE/kdebase/workspace/libs/plasma/popupapplet.h #854046:854047
> @@ -88,6 +88,12 @@
> */
> void showPopup(uint displayTime = 0);
> 
> +    /**
> +     * This event handler can be reimplemented in a subclass to receive an event \
> before the popup is showed or hidden. +     * @arg show true if the popup is going \
> to be showed, false if the popup is going to be hiden. +     */
> +     virtual void popupEvent(bool show);
> +
> public Q_SLOTS:
> /**
> * Hides the popup.
> _______________________________________________
> Plasma-devel mailing list
> Plasma-devel@kde.org
> https://mail.kde.org/mailman/listinfo/plasma-devel
> 
> 

_______________________________________________
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