[PC-BSD Commits] r8004 - pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager

svn at pcbsd.org svn at pcbsd.org
Sun Nov 7 14:19:19 PST 2010


Author: kris
Date: 2010-11-07 14:19:19 -0800 (Sun, 07 Nov 2010)
New Revision: 8004

Modified:
   pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
Log:

In the networkmanager, display the SSID in the status



Modified: pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-11-07 22:02:52 UTC (rev 8003)
+++ pcbsd/current/src-qt4/pc-netmanager/src/NetworkManager/networkman.cpp	2010-11-07 22:19:19 UTC (rev 8004)
@@ -378,13 +378,36 @@
    DevsStatus[sel] = getStatusForIdent(Devs[sel]);
    DevsNetmask[sel] = getNetmaskForIdent(Devs[sel]);
     
-   textStatusLabel1->setText("Address:");	
+   textStatusLabel1->setText(tr("Address:"));	
    textStatus1->setText(tr("IP: ") + DevsIP[sel] + " / " + tr("Netmask: ") + DevsNetmask[sel]);
-    
-   textStatusLabel2->setText("MAC Address:");
-   textStatus2->setText(DevsMAC[sel]);
+
+   if ( getTypeForIdent(Devs[sel]) == "Wireless" )
+   {
+     textStatusLabel2->setText(tr("SSID:"));
+     QString SSID = ""; 
+     QString tmp;
+       
+     QProcess *getIfProc = new QProcess();
+     getIfProc->start(QString("ifconfig"), QStringList() << Devs[sel]);
+     if (getIfProc->waitForFinished(2000)) {
+       tmp = getIfProc->readAllStandardOutput().simplified();
+     }
+
+     getIfProc->kill();
+     delete getIfProc;
+
+     if (tmp != "" && tmp.indexOf("ssid ") != -1){
+    	SSID = tmp.remove(0, tmp.indexOf("ssid ") + 5);
+    	SSID.truncate(tmp.indexOf("channel") - 1 );
+     }
+
+     textStatus2->setText(SSID);
+   } else {
+     textStatusLabel2->setText(tr("MAC Address:"));
+     textStatus2->setText(DevsMAC[sel]);
+   }
    
-   textStatusLabel3->setText("Status:");
+   textStatusLabel3->setText(tr("Status:"));
    textStatus3->setText(DevsStatus[sel]);
     
   }



More information about the Commits mailing list