-rw-r--r-- | noncore/net/opiestumbler/opiestumbler.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/net/opiestumbler/opiestumbler.cpp b/noncore/net/opiestumbler/opiestumbler.cpp index 3531162..9b0d099 100644 --- a/noncore/net/opiestumbler/opiestumbler.cpp +++ b/noncore/net/opiestumbler/opiestumbler.cpp @@ -1,144 +1,143 @@ #include <cstdlib> #include <qmenubar.h> #include <qaction.h> #include <qlistview.h> #include <qstring.h> //#include <qapplication.h> #include <qdatetime.h> #include <qpopupmenu.h> #include <qstatusbar.h> #include <qlayout.h> #include <qwhatsthis.h> #include <qtimer.h> #include <qprogressbar.h> -#include <qpe/resource.h> #include <qpe/config.h> //#include <qpe/global.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> #include <opie2/odebug.h> #include <opie2/ostation.h> #include <opie2/omanufacturerdb.h> #include <opie2/onetwork.h> #include <opie2/oprocess.h> #include "stumbler.h" #include "opiestumbler.h" #include "stumblersettings.h" #include "stationviewitem.h" #include "stumblerstation.h" #include "stationinfo.h" using Opie::Net::OWirelessNetworkInterface; using Opie::Net::ONetwork; QString OpieStumbler::appCaption() { return QObject::tr("OpieStumbler"); } OpieStumbler::OpieStumbler(QWidget *parent, const char *name, WFlags) :QMainWindow(parent, name, WStyle_ContextHelp), m_listCurrent(new QListView(this)), m_listHistory(new QListView(this)), m_stationsCurrent(new QList<Opie::Net::OStation>), m_popupCurrent(new QPopupMenu(this)), m_popupHistory(new QPopupMenu(this)), m_db(NULL), m_proc(NULL) { if ( QCopChannel::isRegistered("QPE/OpieStumbler") ) { QCopEnvelope e("QPE/OpieStumbler", "show()"); exit(EXIT_SUCCESS); } QGridLayout *grid = new QGridLayout( this, 1, 1, 3, 0, "grid"); QVBoxLayout *lay = new QVBoxLayout( NULL, 0, 5, "lay" ); QSpacerItem *spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed ); lay->addItem(spacer); lay->addWidget(m_listCurrent); lay->addWidget(m_listHistory); grid->addLayout(lay, 0, 0); m_stationsCurrent->setAutoDelete(true); m_channel = new QCopChannel( "QPE/OpieStumbler", this ); connect(m_channel, SIGNAL(received(const QCString &, const QByteArray &)), this, SLOT(slotMessageReceived( const QCString &, const QByteArray &)) ); //setCaption(appCaption()); //setCentralWidget(grid); setToolBarsMovable(false); QPopupMenu *fileMenu = new QPopupMenu(this); QPopupMenu *configMenu = new QPopupMenu(this); QPopupMenu *scanMenu = new QPopupMenu(this); fileMenu->insertItem( tr("Exit"), this, SLOT(close()) ); configMenu->insertItem( tr("Configure"), this, SLOT(slotConfigure()) ); scanMenu->insertItem( tr("Start"), this, SLOT(slotStartScanning()) ); scanMenu->insertItem( tr("Stop"), this, SLOT(slotStopScanning()) ); m_popupCurrent->insertItem( tr("Show details"), this, SLOT(slotShowDetails()) ); m_popupCurrent->insertItem( tr("Join Network"), this, SLOT(slotJoinNetwork()) ); menuBar()->insertItem(tr("File"), fileMenu); menuBar()->insertItem(tr("Settings"), configMenu); menuBar()->insertItem(tr("Scanning"), scanMenu); QPEApplication::setStylusOperation(m_listCurrent->viewport(), QPEApplication::RightOnHold); QPEApplication::setStylusOperation(m_listHistory->viewport(), QPEApplication::RightOnHold); m_listCurrent->addColumn(tr("SSID")); m_listCurrent->addColumn(tr("Chan")); m_listCurrent->addColumn(tr("Signal")); m_listCurrent->addColumn(tr("Enc")); m_listCurrent->setSelectionMode( QListView::Extended ); m_listHistory->addColumn(tr("SSID")); m_listHistory->addColumn(tr("Chan")); m_listHistory->addColumn(tr("Max Sig")); m_listHistory->addColumn(tr("Enc")); m_listHistory->addColumn(tr("Vendor")); connect(m_listCurrent, SIGNAL(mouseButtonPressed (int, QListViewItem*, const QPoint&, int)), this, SLOT(slotCurrentMousePressed (int, QListViewItem*, const QPoint&, int))); connect(m_listHistory, SIGNAL(mouseButtonPressed (int, QListViewItem*, const QPoint&, int)), this, SLOT(slotHistoryMousePressed (int, QListViewItem*, const QPoint&, int))); for(int i = CURCHAN; i <= CURENC; ++i) { m_listCurrent->setColumnAlignment( i, Qt::AlignHCenter ); m_listHistory->setColumnAlignment( i, Qt::AlignHCenter ); } loadConfig(); m_stumbler = new Stumbler(m_interface, this); connect(m_stumbler, SIGNAL(newdata()), this, SLOT(slotUpdateStations())); QTimer::singleShot(1000, this, SLOT(slotLoadManufacturers()) ); slotStartScanning(); } void OpieStumbler::slotConfigure() { StumblerSettings settings(this, "Settings", true); if (settings.exec() == QDialog::Accepted) loadConfig(); } void OpieStumbler::loadConfig() { Config cfg("OpieStumbler", Config::User); cfg.setGroup("General"); m_interface = cfg.readEntry("interface", "wlan0"); } void OpieStumbler::slotStartScanning() { setCaption(appCaption() + " (" + tr("Scanning") + ")"); |