[PC-BSD Commits] r139 - in pcbsd/trunk: NetworkTray ethernetconfig/src wificonfig

svn at pcbsd.org svn at pcbsd.org
Wed Mar 14 14:03:38 PST 2007


Author: kris
Date: 2007-03-14 23:03:37 +0100 (Wed, 14 Mar 2007)
New Revision: 139

Modified:
   pcbsd/trunk/NetworkTray/NetworkTray.cpp
   pcbsd/trunk/NetworkTray/NetworkTray.h
   pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.cpp
   pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.h
   pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui
   pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui.h
Log:
Added media / gateway tags to network tray and info tabs. 

Modified: pcbsd/trunk/NetworkTray/NetworkTray.cpp
===================================================================
--- pcbsd/trunk/NetworkTray/NetworkTray.cpp	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/NetworkTray/NetworkTray.cpp	2007-03-14 22:03:37 UTC (rev 139)
@@ -17,12 +17,13 @@
 #include "NetworkTray.h"
 
 /* Update interval in ms */
-#define  UPDATE_MSEC 3000
+#define  UPDATE_MSEC 4000
 
 // Public Variables
 QString DeviceName;
 QString DeviceType;
 QString DeviceIP;
+QString DeviceIPv6;
 QString DeviceMAC;
 QString DeviceSSID;
 QString DeviceSignalStrength = "";
@@ -32,6 +33,8 @@
 QString DeviceUpStatus;
 QString DeviceIdent;
 QString DeviceNetmask;
+QString DeviceMedia;
+QString DeviceGateway;
 QString username;
 
 
@@ -51,11 +54,14 @@
 
     DeviceStatus = getStatusForIdent( DeviceName );
     DeviceIP = getIpForIdent( DeviceName );
+    DeviceIPv6 = getIPv6ForIdent( DeviceName);
     DeviceMAC = getMacForIdent( DeviceName );
     DeviceStatus = getStatusForIdent( DeviceName );
     DeviceIdent = getNameForIdent( DeviceName );
     DeviceNetmask = getNetmaskForIdent( DeviceName );
     DeviceUpStatus = getUpStatusForIdent( DeviceName );
+    DeviceMedia = getMediaForIdent( DeviceName );
+    DeviceGateway = getGatewayForIdent( DeviceName );
 
 //QMessageBox::information( this, "Application name",  "IP: " );
 
@@ -362,11 +368,15 @@
        {
             if ( DeviceStatus == "active" || DeviceStatus == "" ) {
    		tooltipStr += "<br>" + tr("IP:") + " " + DeviceIP;
+	        tooltipStr += "<br>" + tr("IPv6:") + " " + DeviceIPv6;
 		tooltipStr += "<br>" + tr("Netmask:") + " " + DeviceNetmask;
-		tooltipStr += "<br>" + tr("MAC:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Gateway:") + " " + DeviceGateway;
+		tooltipStr += "<br>" + tr("Mac/Ether:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Media:") + " " + DeviceMedia;
    		tooltipStr += "<br>" + tr("Status:") + " " + DeviceUpStatus;
 	    } else {
-   		tooltipStr += "<br>" + tr("MAC:") + " " + DeviceMAC;
+   		tooltipStr += "<br>" + tr("Mac/Ether:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Media:") + " " + DeviceMedia;
    		tooltipStr += "<br>" + tr("Status:") + " " + DeviceStatus;
 		tooltipStr += "<br>" + tr("No connection detected.<br> Check your cable connection and try again!");
 	    }
@@ -375,14 +385,18 @@
 	// If this is a wireless device, give different output
             if ( DeviceStatus == "associated" ) {
 		tooltipStr += "<br>" + tr("IP:") + " " + DeviceIP;
+		tooltipStr += "<br>" + tr("IPv6:") + " " + DeviceIPv6;
 		tooltipStr += "<br>" + tr("Netmask:") + " " + DeviceNetmask;
+		tooltipStr += "<br>" + tr("Gateway:") + " " + DeviceGateway;
       		tooltipStr += "<br>" + tr("SSID:") + " " + DeviceSSID;
       		tooltipStr += "<br>" + tr("Connection Strength:") + " " + DeviceSignalStrength + "%";
       		tooltipStr += "<br>" + tr("Connection Speed:") + " " + DeviceWirelessSpeed;
-		tooltipStr += "<br>" + tr("MAC:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Mac/Ether:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Media:") + " " + DeviceMedia;
    		tooltipStr += "<br>" + tr("Status:") + " " + DeviceStatus;
 	    } else {
-		tooltipStr += "<br>" + tr("MAC:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Mac/Ether:") + " " + DeviceMAC;
+		tooltipStr += "<br>" + tr("Media:") + " " + DeviceMedia;
    		tooltipStr += "<br>" + tr("Status:") + " " + DeviceStatus;
 		tooltipStr += "<br>" + tr("No wireless connection detected.<br> Double-click to start the wireless configuration wizard.");
 	    }
@@ -411,6 +425,38 @@
     close(0);
   }
 
+  // Check the media status of this device
+  tmp = getMediaForIdent( DeviceName );
+  if ( DeviceMedia != tmp )
+  {
+     // Save the status as the new status now
+     DeviceMedia = tmp;
+     updateTooltip = 1;
+  }
+
+  // Check for Gateway Changes
+  tmp = getGatewayForIdent( DeviceName);
+  if ( DeviceGateway != tmp )
+  {
+     NotifyText+="Gateway changed to: " + tmp + "<br>";
+     displayPassivePopup = 1;
+     // Save the status as the new status now
+     DeviceGateway= tmp;
+     updateTooltip = 1;
+  }
+
+
+  // Check for IPv6 Changes
+  tmp = getIPv6ForIdent( DeviceName);
+  if ( DeviceIPv6 != tmp )
+  {
+     NotifyText+="IPv6 changed to: " + tmp + "<br>";
+     displayPassivePopup = 1;
+     // Save the status as the new status now
+     DeviceIPv6 = tmp;
+     updateTooltip = 1;
+  }
+
   // Get the device up status
   tmp = getUpStatusForIdent( DeviceName );
   if ( DeviceUpStatus != tmp )
@@ -689,7 +735,7 @@
 
 QString NetworkTray::getUpStatusForIdent( QString ident )
 {
-        	QString command = "ifconfig " +ident + " | grep \"flags=\"";
+        	QString command = "nice ifconfig " +ident + " | grep \"flags=\"";
 	QString inputLine = getLineFromCommandOutput(command);
 	QString status = "";
 	
@@ -703,3 +749,53 @@
     
 }
 
+QString NetworkTray::getMediaForIdent( QString ident )
+{
+    	QString command = "nice ifconfig " +ident + " | grep \"media:\"";
+	QString inputLine = getLineFromCommandOutput(command);
+	QString status = "";
+	
+	if (inputLine != "" && inputLine.find("media:") != -1){
+		
+		status = inputLine.remove(0, inputLine.find("media:") + 7);
+		status.truncate(inputLine.find("\n") );
+	
+	}
+	
+	return status;
+	
+
+
+}
+
+QString NetworkTray::getIPv6ForIdent( QString ident )
+{
+	QString command = "nice ifconfig " +ident + " | grep \"inet6 \"";
+	QString inputLine = getLineFromCommandOutput(command);
+	QString ip= "";
+	
+	if (inputLine != "" && inputLine.find("inet6 ") != -1){
+		
+		ip = inputLine.remove(0, inputLine.find("inet6 ") + 5);
+		ip.truncate(ip.find("%"));
+		
+		
+	}
+	
+	return ip;
+}
+
+QString NetworkTray::getGatewayForIdent( QString ident )
+{
+        QString command = "nice netstat -n -r | grep \"default\" | grep " + ident;
+	QString inputLine = getLineFromCommandOutput(command);
+	QString packets = "";
+	
+	if (inputLine != "" ){
+		inputLine = inputLine.simplifyWhiteSpace();
+		packets = inputLine.section(' ', 1, 1 );
+	}
+	
+	return packets;
+}
+

Modified: pcbsd/trunk/NetworkTray/NetworkTray.h
===================================================================
--- pcbsd/trunk/NetworkTray/NetworkTray.h	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/NetworkTray/NetworkTray.h	2007-03-14 22:03:37 UTC (rev 139)
@@ -41,5 +41,8 @@
    QString getWirelessSpeedForIdent( QString ident );
    QString getValue( QString File, QString Key, int occur );
    QString getUpStatusForIdent( QString ident );
+   QString getMediaForIdent( QString ident );
+   QString getIPv6ForIdent( QString ident );
+   QString getGatewayForIdent( QString ident );
 
 };

Modified: pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.cpp
===================================================================
--- pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.cpp	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.cpp	2007-03-14 22:03:37 UTC (rev 139)
@@ -410,6 +410,7 @@
   textStatus->setText(getStatusForIdent( DeviceName ) );
   textIPv6->setText(getIPv6ForIdent( DeviceName) );
   textGateway->setText(getGatewayForIdent(DeviceName) );
+  textMedia->setText(getMediaForIdent(DeviceName) );
 
   // Get the packet status for this device
   textPacketsIn->setText(getInPacketsForIdent( DeviceName) );
@@ -694,7 +695,7 @@
 
 QString ethernetconfigWidget::getIPv6ForIdent(QString ident)
 {
-	QString command = "ifconfig " +ident + " | grep \"inet6 \"";
+	QString command = "nice ifconfig " +ident + " | grep \"inet6 \"";
 	QString inputLine = getLineFromCommandOutput(command);
 	QString ip= "";
 	
@@ -711,7 +712,7 @@
 
 QString ethernetconfigWidget::getGatewayForIdent(QString ident)
 {
-        QString command = "netstat -n -r | grep \"default\" | grep " + ident;
+        QString command = "nice netstat -n -r | grep \"default\" | grep " + ident;
 	QString inputLine = getLineFromCommandOutput(command);
 	QString packets = "";
 	
@@ -723,8 +724,25 @@
 	return packets;
 }
 
+QString ethernetconfigWidget::getMediaForIdent( QString ident )
+{
+    	QString command = "nice ifconfig " +ident + " | grep \"media:\"";
+	QString inputLine = getLineFromCommandOutput(command);
+	QString status = "";
+	
+	if (inputLine != "" && inputLine.find("media:") != -1){
+		
+		status = inputLine.remove(0, inputLine.find("media:") + 7);
+		status.truncate(inputLine.find("\n") );
+	
+	}
+	
+	return status;
+}
 
 
 
+
+
 #include "ethernetconfigwidget.moc"
 

Modified: pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.h
===================================================================
--- pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.h	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/ethernetconfig/src/ethernetconfigwidget.h	2007-03-14 22:03:37 UTC (rev 139)
@@ -90,6 +90,8 @@
     virtual QString getGatewayForIdent(QString ident);
 private:
     virtual QString getIPv6ForIdent(QString ident);
+private:
+    virtual QString getMediaForIdent( QString ident );
 };
 
 #endif

Modified: pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui
===================================================================
--- pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui	2007-03-14 22:03:37 UTC (rev 139)
@@ -8,8 +8,8 @@
         <rect>
             <x>0</x>
             <y>0</y>
-            <width>338</width>
-            <height>441</height>
+            <width>348</width>
+            <height>463</height>
         </rect>
     </property>
     <property name="caption">
@@ -423,176 +423,155 @@
                             <string></string>
                         </property>
                     </widget>
-                    <widget class="QGroupBox" row="2" column="0">
+                    <widget class="QGroupBox" row="1" column="0">
                         <property name="name">
-                            <cstring>groupBox5</cstring>
+                            <cstring>groupBox4</cstring>
                         </property>
                         <property name="title">
-                            <string>Traffic info</string>
+                            <string>Configuration info</string>
                         </property>
                         <grid>
                             <property name="name">
                                 <cstring>unnamed</cstring>
                             </property>
-                            <widget class="QLabel" row="1" column="2">
+                            <widget class="QLabel" row="0" column="0">
                                 <property name="name">
-                                    <cstring>textPacketsOut</cstring>
+                                    <cstring>textLabel3_3</cstring>
                                 </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>1</hsizetype>
+                                        <vsizetype>5</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
                                 <property name="text">
-                                    <string></string>
+                                    <string>IP:</string>
                                 </property>
                                 <property name="alignment">
-                                    <set>AlignCenter</set>
+                                    <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="1" column="1">
+                            <widget class="QLabel" row="4" column="0">
                                 <property name="name">
-                                    <cstring>textPacketsIn</cstring>
+                                    <cstring>textLabel3_2_2_2_2</cstring>
                                 </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>1</hsizetype>
+                                        <vsizetype>5</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
                                 <property name="text">
-                                    <string></string>
+                                    <string>Mac/Ether:</string>
                                 </property>
                                 <property name="alignment">
-                                    <set>AlignCenter</set>
+                                    <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="2" column="2">
+                            <widget class="QLabel" row="4" column="1">
                                 <property name="name">
-                                    <cstring>textPacketsOutErrors</cstring>
+                                    <cstring>textMac</cstring>
                                 </property>
                                 <property name="text">
                                     <string></string>
                                 </property>
-                                <property name="alignment">
-                                    <set>AlignCenter</set>
-                                </property>
                             </widget>
-                            <widget class="QLabel" row="2" column="1">
+                            <widget class="QLabel" row="1" column="0">
                                 <property name="name">
-                                    <cstring>textPacketsInErrors</cstring>
+                                    <cstring>textLabel3_2_2</cstring>
                                 </property>
+                                <property name="sizePolicy">
+                                    <sizepolicy>
+                                        <hsizetype>1</hsizetype>
+                                        <vsizetype>5</vsizetype>
+                                        <horstretch>0</horstretch>
+                                        <verstretch>0</verstretch>
+                                    </sizepolicy>
+                                </property>
                                 <property name="text">
-                                    <string></string>
+                                    <string>Netmask:</string>
                                 </property>
                                 <property name="alignment">
-                                    <set>AlignCenter</set>
+                                    <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="1" column="0">
+                            <widget class="QLabel" row="2" column="0">
                                 <property name="name">
-                                    <cstring>textLabel6</cstring>
+                                    <cstring>textLabel3_2_3</cstring>
                                 </property>
                                 <property name="text">
-                                    <string>Packets:</string>
+                                    <string>Gateway:</string>
                                 </property>
                                 <property name="alignment">
                                     <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="2" column="0">
+                            <widget class="QLabel" row="3" column="0">
                                 <property name="name">
-                                    <cstring>textLabel6_2</cstring>
+                                    <cstring>textLabel3_2_3_2</cstring>
                                 </property>
                                 <property name="text">
-                                    <string>Errors:</string>
+                                    <string>IPv6:</string>
                                 </property>
                                 <property name="alignment">
                                     <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <spacer row="0" column="0">
+                            <widget class="QLabel" row="3" column="1">
                                 <property name="name">
-                                    <cstring>spacer8_2</cstring>
+                                    <cstring>textIPv6</cstring>
                                 </property>
-                                <property name="orientation">
-                                    <enum>Vertical</enum>
-                                </property>
-                                <property name="sizeType">
-                                    <enum>Expanding</enum>
-                                </property>
-                                <property name="sizeHint">
-                                    <size>
-                                        <width>20</width>
-                                        <height>20</height>
-                                    </size>
-                                </property>
-                            </spacer>
-                            <widget class="QLabel" row="0" column="1">
-                                <property name="name">
-                                    <cstring>textLabel5</cstring>
-                                </property>
                                 <property name="text">
-                                    <string>In:</string>
+                                    <string></string>
                                 </property>
-                                <property name="alignment">
-                                    <set>AlignCenter</set>
-                                </property>
                             </widget>
-                            <widget class="QLabel" row="0" column="2">
+                            <widget class="QLabel" row="2" column="1">
                                 <property name="name">
-                                    <cstring>textLabel5_2</cstring>
+                                    <cstring>textGateway</cstring>
                                 </property>
                                 <property name="text">
-                                    <string>Out:</string>
+                                    <string></string>
                                 </property>
-                                <property name="alignment">
-                                    <set>AlignCenter</set>
-                                </property>
                             </widget>
-                        </grid>
-                    </widget>
-                    <widget class="QGroupBox" row="1" column="0">
-                        <property name="name">
-                            <cstring>groupBox4</cstring>
-                        </property>
-                        <property name="title">
-                            <string>Configuration info</string>
-                        </property>
-                        <grid>
-                            <property name="name">
-                                <cstring>unnamed</cstring>
-                            </property>
-                            <widget class="QLabel" row="0" column="0">
+                            <widget class="QLabel" row="1" column="1">
                                 <property name="name">
-                                    <cstring>textLabel3_3</cstring>
+                                    <cstring>textNetmask</cstring>
                                 </property>
                                 <property name="sizePolicy">
                                     <sizepolicy>
-                                        <hsizetype>1</hsizetype>
+                                        <hsizetype>7</hsizetype>
                                         <vsizetype>5</vsizetype>
                                         <horstretch>0</horstretch>
                                         <verstretch>0</verstretch>
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>IP:</string>
+                                    <string></string>
                                 </property>
-                                <property name="alignment">
-                                    <set>AlignVCenter|AlignRight</set>
-                                </property>
                             </widget>
-                            <widget class="QLabel" row="5" column="0">
+                            <widget class="QLabel" row="0" column="1">
                                 <property name="name">
-                                    <cstring>textLabel3_2_2_2</cstring>
+                                    <cstring>textIP</cstring>
                                 </property>
                                 <property name="sizePolicy">
                                     <sizepolicy>
-                                        <hsizetype>1</hsizetype>
+                                        <hsizetype>7</hsizetype>
                                         <vsizetype>5</vsizetype>
                                         <horstretch>0</horstretch>
                                         <verstretch>0</verstretch>
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>Status:</string>
+                                    <string></string>
                                 </property>
-                                <property name="alignment">
-                                    <set>AlignVCenter|AlignRight</set>
-                                </property>
                             </widget>
-                            <widget class="QLabel" row="4" column="0">
+                            <widget class="QLabel" row="6" column="0">
                                 <property name="name">
-                                    <cstring>textLabel3_2_2_2_2</cstring>
+                                    <cstring>textLabel3_2_2_2</cstring>
                                 </property>
                                 <property name="sizePolicy">
                                     <sizepolicy>
@@ -603,13 +582,13 @@
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>Mac:</string>
+                                    <string>Status:</string>
                                 </property>
                                 <property name="alignment">
                                     <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="5" column="1">
+                            <widget class="QLabel" row="6" column="1">
                                 <property name="name">
                                     <cstring>textStatus</cstring>
                                 </property>
@@ -617,17 +596,23 @@
                                     <string></string>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="4" column="1">
+                            <widget class="QLabel" row="5" column="1">
                                 <property name="name">
-                                    <cstring>textMac</cstring>
+                                    <cstring>textMedia</cstring>
                                 </property>
                                 <property name="text">
                                     <string></string>
                                 </property>
+                                <property name="scaledContents">
+                                    <bool>true</bool>
+                                </property>
+                                <property name="alignment">
+                                    <set>WordBreak|AlignVCenter</set>
+                                </property>
                             </widget>
-                            <widget class="QLabel" row="1" column="0">
+                            <widget class="QLabel" row="5" column="0">
                                 <property name="name">
-                                    <cstring>textLabel3_2_2</cstring>
+                                    <cstring>textLabel3_2_2_2_3</cstring>
                                 </property>
                                 <property name="sizePolicy">
                                     <sizepolicy>
@@ -638,84 +623,149 @@
                                     </sizepolicy>
                                 </property>
                                 <property name="text">
-                                    <string>Netmask:</string>
+                                    <string>Media:</string>
                                 </property>
                                 <property name="alignment">
                                     <set>AlignVCenter|AlignRight</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="2" column="0">
+                        </grid>
+                    </widget>
+                    <widget class="QGroupBox" row="2" column="0">
+                        <property name="name">
+                            <cstring>groupBox5</cstring>
+                        </property>
+                        <property name="title">
+                            <string>Traffic info</string>
+                        </property>
+                        <grid>
+                            <property name="name">
+                                <cstring>unnamed</cstring>
+                            </property>
+                            <widget class="QLabel" row="1" column="2">
                                 <property name="name">
-                                    <cstring>textLabel3_2_3</cstring>
+                                    <cstring>textPacketsOut</cstring>
                                 </property>
                                 <property name="text">
-                                    <string>Gateway:</string>
+                                    <string></string>
                                 </property>
                                 <property name="alignment">
-                                    <set>AlignVCenter|AlignRight</set>
+                                    <set>AlignCenter</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="3" column="0">
+                            <widget class="QLabel" row="1" column="1">
                                 <property name="name">
-                                    <cstring>textLabel3_2_3_2</cstring>
+                                    <cstring>textPacketsIn</cstring>
                                 </property>
                                 <property name="text">
-                                    <string>IPv6:</string>
+                                    <string></string>
                                 </property>
                                 <property name="alignment">
-                                    <set>AlignVCenter|AlignRight</set>
+                                    <set>AlignCenter</set>
                                 </property>
                             </widget>
-                            <widget class="QLabel" row="3" column="1">
+                            <widget class="QLabel" row="2" column="2">
                                 <property name="name">
-                                    <cstring>textIPv6</cstring>
+                                    <cstring>textPacketsOutErrors</cstring>
                                 </property>
                                 <property name="text">
                                     <string></string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignCenter</set>
+                                </property>
                             </widget>
                             <widget class="QLabel" row="2" column="1">
                                 <property name="name">
-                                    <cstring>textGateway</cstring>
+                                    <cstring>textPacketsInErrors</cstring>
                                 </property>
                                 <property name="text">
                                     <string></string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignCenter</set>
+                                </property>
                             </widget>
-                            <widget class="QLabel" row="1" column="1">
+                            <widget class="QLabel" row="1" column="0">
                                 <property name="name">
-                                    <cstring>textNetmask</cstring>
+                                    <cstring>textLabel6</cstring>
                                 </property>
-                                <property name="sizePolicy">
-                                    <sizepolicy>
-                                        <hsizetype>7</hsizetype>
-                                        <vsizetype>5</vsizetype>
-                                        <horstretch>0</horstretch>
-                                        <verstretch>0</verstretch>
-                                    </sizepolicy>
+                                <property name="text">
+                                    <string>Packets:</string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignVCenter|AlignRight</set>
+                                </property>
+                            </widget>
+                            <widget class="QLabel" row="2" column="0">
+                                <property name="name">
+                                    <cstring>textLabel6_2</cstring>
+                                </property>
                                 <property name="text">
-                                    <string></string>
+                                    <string>Errors:</string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignVCenter|AlignRight</set>
+                                </property>
                             </widget>
+                            <spacer row="0" column="0">
+                                <property name="name">
+                                    <cstring>spacer8_2</cstring>
+                                </property>
+                                <property name="orientation">
+                                    <enum>Vertical</enum>
+                                </property>
+                                <property name="sizeType">
+                                    <enum>Expanding</enum>
+                                </property>
+                                <property name="sizeHint">
+                                    <size>
+                                        <width>20</width>
+                                        <height>20</height>
+                                    </size>
+                                </property>
+                            </spacer>
                             <widget class="QLabel" row="0" column="1">
                                 <property name="name">
-                                    <cstring>textIP</cstring>
+                                    <cstring>textLabel5</cstring>
                                 </property>
-                                <property name="sizePolicy">
-                                    <sizepolicy>
-                                        <hsizetype>7</hsizetype>
-                                        <vsizetype>5</vsizetype>
-                                        <horstretch>0</horstretch>
-                                        <verstretch>0</verstretch>
-                                    </sizepolicy>
+                                <property name="text">
+                                    <string>In:</string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignCenter</set>
+                                </property>
+                            </widget>
+                            <widget class="QLabel" row="0" column="2">
+                                <property name="name">
+                                    <cstring>textLabel5_2</cstring>
+                                </property>
                                 <property name="text">
-                                    <string></string>
+                                    <string>Out:</string>
                                 </property>
+                                <property name="alignment">
+                                    <set>AlignCenter</set>
+                                </property>
                             </widget>
                         </grid>
                     </widget>
+                    <spacer row="3" column="0">
+                        <property name="name">
+                            <cstring>spacer9</cstring>
+                        </property>
+                        <property name="orientation">
+                            <enum>Vertical</enum>
+                        </property>
+                        <property name="sizeType">
+                            <enum>Fixed</enum>
+                        </property>
+                        <property name="sizeHint">
+                            <size>
+                                <width>300</width>
+                                <height>10</height>
+                            </size>
+                        </property>
+                    </spacer>
                 </grid>
             </widget>
         </widget>
@@ -936,6 +986,7 @@
     <function>showInfo()</function>
     <function access="private" returnType="QString">getIPv6ForIdent( QString ident )</function>
     <function access="private" returnType="QString">getGatewayForIdent( QString ident )</function>
+    <function access="private" returnType="QString">getMediaForIdent( QString ident )</function>
 </functions>
 <layoutdefaults spacing="6" margin="11"/>
 </UI>

Modified: pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui.h
===================================================================
--- pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui.h	2007-03-14 19:49:40 UTC (rev 138)
+++ pcbsd/trunk/wificonfig/wificonfigwidgetbase.ui.h	2007-03-14 22:03:37 UTC (rev 139)
@@ -803,7 +803,8 @@
   textStatus->setText(getStatusForIdent( DeviceName ) );
   textIPv6->setText(getIPv6ForIdent( DeviceName) );
   textGateway->setText(getGatewayForIdent(DeviceName) );
-
+  textMedia->setText(getMediaForIdent(DeviceName ) );
+  
   // Get the packet status for this device
   textPacketsIn->setText(getInPacketsForIdent( DeviceName) );
   textPacketsInErrors->setText( getInErrorsForIdent( DeviceName) );
@@ -1040,7 +1041,7 @@
 
 QString wificonfigWidgetBase::getIPv6ForIdent( QString ident )
 {
-	QString command = "ifconfig " +ident + " | grep \"inet6 \"";
+	QString command = "nice ifconfig " +ident + " | grep \"inet6 \"";
 	QString inputLine = getLineFromCommandOutput(command);
 	QString ip= "";
 	
@@ -1058,7 +1059,7 @@
 
 QString wificonfigWidgetBase::getGatewayForIdent( QString ident )
 {
-        QString command = "netstat -n -r | grep \"default\" | grep " + ident;
+        QString command = "nice netstat -n -r | grep \"default\" | grep " + ident;
 	QString inputLine = getLineFromCommandOutput(command);
 	QString packets = "";
 	
@@ -1069,3 +1070,20 @@
 	
 	return packets;
 }
+
+
+QString wificonfigWidgetBase::getMediaForIdent( QString ident )
+{
+    	QString command = "nice ifconfig " +ident + " | grep \"media:\"";
+	QString inputLine = getLineFromCommandOutput(command);
+	QString status = "";
+	
+	if (inputLine != "" && inputLine.find("media:") != -1){
+		
+		status = inputLine.remove(0, inputLine.find("media:") + 7);
+		status.truncate(inputLine.find("\n") );
+	
+	}
+	
+	return status;
+}



More information about the Commits mailing list