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

List:       kde-commits
Subject:    playground/network/ksniffer
From:       Giovanni Venturi <gventuri73 () tiscali ! it>
Date:       2007-01-07 22:15:53
Message-ID: 1168208153.788545.7091.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 620975 by gianni:

moving to the center of the mainwidget a KPassivePopup

 M  +15 -4     ksniffer.cpp  


--- trunk/playground/network/ksniffer/ksniffer.cpp #620974:620975
@@ -979,11 +979,22 @@
 
   if (m_sniffer->countPackets() > 0)
   {
-    //FIXME: move this popup in the KSniffer center view
+    //FIXME: use this code in all KPassivePopup calls ;)
     QPixmap icon = BarIcon( "ksniffer" );
-    KPassivePopup::message( i18n("Capturing"),
-       i18n("<p>You captured <b>%1</b> packets for a total of <b>%2</b> bytes.</p>")
-       .arg(m_sniffer->countPackets()).arg(m_sniffer->packetsTotalSize()), icon, \
this ); +    KPassivePopup *popup = new KPassivePopup( this, "popup" );
+    popup->setAutoDelete( true );
+    popup->setTimeout( 10*1000 );
+    popup->setView(i18n("Capturing"), i18n("<p>Captured <b>%1</b> packets for a \
total of <b>%2</b> bytes.</p>") +      \
.arg(m_sniffer->countPackets()).arg(m_sniffer->packetsTotalSize()), icon); +
+    if (isShown() && !isMinimized())
+    {
+      popup->show( QPoint(x() + (width() - popup->width() / 2) / 2, y() + (height() \
- popup->height() / 2) / 2) ); +    }
+    else
+    {
+      popup->show();
+    }
   }
 }
 


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

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