Updated through tag hostap_2_5 from git://w1.fi/hostap.git
[mech_eap.git] / libeap / wpa_supplicant / wpa_gui-qt4 / scanresults.cpp
index 459aa8c..a2e3072 100644 (file)
@@ -2,24 +2,20 @@
  * wpa_gui - ScanResults class
  * Copyright (c) 2005-2006, Jouni Malinen <j@w1.fi>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Alternatively, this software may be distributed under the terms of BSD
- * license.
- *
- * See README and COPYING for more details.
+ * This software may be distributed under the terms of the BSD license.
+ * See README for more details.
  */
 
 #include <cstdio>
 
 #include "scanresults.h"
+#include "signalbar.h"
 #include "wpagui.h"
 #include "networkconfig.h"
+#include "scanresultsitem.h"
 
 
-ScanResults::ScanResults(QWidget *parent, const char *, bool, Qt::WFlags)
+ScanResults::ScanResults(QWidget *parent, const char *, bool, Qt::WindowFlags)
        : QDialog(parent)
 {
        setupUi(this);
@@ -31,8 +27,9 @@ ScanResults::ScanResults(QWidget *parent, const char *, bool, Qt::WFlags)
                SLOT(bssSelected(QTreeWidgetItem *)));
 
        wpagui = NULL;
-       scanResultsWidget->setItemsExpandable(FALSE);
-       scanResultsWidget->setRootIsDecorated(FALSE);
+       scanResultsWidget->setItemsExpandable(false);
+       scanResultsWidget->setRootIsDecorated(false);
+       scanResultsWidget->setItemDelegate(new SignalBar(scanResultsWidget));
 }
 
 
@@ -91,7 +88,7 @@ void ScanResults::updateResults()
                                bssid = (*it).mid(pos);
                        else if ((*it).startsWith("freq="))
                                freq = (*it).mid(pos);
-                       else if ((*it).startsWith("qual="))
+                       else if ((*it).startsWith("level="))
                                signal = (*it).mid(pos);
                        else if ((*it).startsWith("flags="))
                                flags = (*it).mid(pos);
@@ -99,7 +96,7 @@ void ScanResults::updateResults()
                                ssid = (*it).mid(pos);
                }
 
-               QTreeWidgetItem *item = new QTreeWidgetItem(scanResultsWidget);
+               ScanResultsItem *item = new ScanResultsItem(scanResultsWidget);
                if (item) {
                        item->setText(0, ssid);
                        item->setText(1, bssid);