1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-14 03:10:47 +00:00
freebsd-ports/net/knemo/files/patch-knemod-interfacestatusdialog.cpp
Markus Brueffer 9c29f9eabb Add knemo 0.3.1, a network monitor for KDE.
KNemo offers a network monitor similar to the one found in Windows.
For every network interface it displays an icon in the systray.

http://www.kde-apps.org/content/show.php?content=12956

Note: There are two extensions to the original KNemo:
1. Multiple IPs on devices are supported
2. The semantics of not available devices were changed
   from: "device is not up"
     to: "device is not up" or "device is up but has no carrier/is not
         associated"
   which mimics the behaviour of the Windows counterpart more closely

Bugs: The stats page for wireless specific statistics doesn't work, yet
2005-01-22 01:39:05 +00:00

51 lines
1.7 KiB
C++

--- knemod/interfacestatusdialog.cpp.orig Sat Jan 22 00:11:02 2005
+++ knemod/interfacestatusdialog.cpp Sat Jan 22 00:15:24 2005
@@ -24,6 +24,7 @@
#include <qtabwidget.h>
#include <kdebug.h>
+#include <kcombobox.h>
#include <kconfig.h>
#include <klocale.h>
#include <kglobal.h>
@@ -69,6 +70,10 @@
mTimer = new QTimer();
connect( mTimer, SIGNAL( timeout() ), this, SLOT( updateDialog() ) );
mTimer->start( 1000 );
+
+#ifdef Q_OS_FREEBSD
+ connect( comboBoxIP, SIGNAL( activated(int) ), this, SLOT( updateDialog() ) );
+#endif
}
InterfaceStatusDialog::~InterfaceStatusDialog()
@@ -152,12 +157,28 @@
if ( data.available )
{
// ip tab
+#ifdef Q_OS_FREEBSD
+ if ( data.addrData.count() != comboBoxIP->count() )
+ comboBoxIP->clear();
+
+ QDictIterator<AddrData> it( data.addrData );
+ for( ; it.current(); ++it )
+ if (!comboBoxIP->contains(it.currentKey()))
+ comboBoxIP->insertItem( it.currentKey() );
+
+ textLabelSubnet->setText(data.addrData[ comboBoxIP->currentText() ]->subnetMask);
+#else
textLabelIP->setText( data.ipAddress );
textLabelSubnet->setText( data.subnetMask );
+#endif
if ( mInterface->getType() == Interface::ETHERNET )
{
variableLabel1->setText( i18n( "Broadcast Address:" ) );
+#ifdef Q_OS_FREEBSD
+ variableText1->setText( data.addrData[ comboBoxIP->currentText() ]->broadcastAddress);
+#else
variableText1->setText( data.broadcastAddress );
+#endif
variableLabel2->setText( i18n( "Default Gateway:" ) );
variableText2->setText( data.defaultGateway );
variableLabel3->setText( i18n( "HW-Address:" ) );