author | zecke <zecke> | 2004-10-22 15:11:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-10-22 15:11:42 (UTC) |
commit | 0a3ab70a5be70bb04691a2a566ce63719e57f83e (patch) (side-by-side diff) | |
tree | 7160371d37d8ca5afff098ae183957795b620677 | |
parent | 0ad51ab1359feaf04c3be229250a4e2e93892564 (diff) | |
download | opie-0a3ab70a5be70bb04691a2a566ce63719e57f83e.zip opie-0a3ab70a5be70bb04691a2a566ce63719e57f83e.tar.gz opie-0a3ab70a5be70bb04691a2a566ce63719e57f83e.tar.bz2 |
Open the Context-Menu on rightButtonPress instead of clicked.
This makes wellenreiter behave like other RoH capable applications
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index fa1d724..8c2015e 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp @@ -1,185 +1,185 @@ /********************************************************************** ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Wellenreiter II. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "scanlist.h" #include "configwindow.h" #include "logwindow.h" /* OPIE */ #ifdef QWS #include <opie2/odebug.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #else #include "resource.h" #endif /* QT */ #include <qcursor.h> #include <qdatetime.h> #include <qpopupmenu.h> #include <qcheckbox.h> /* STD */ #include <assert.h> using namespace Opie::Core; using namespace Opie::Ui; using namespace Opie::Net; const int col_type = 0; const int col_essid = 0; const int col_sig = 1; const int col_ap = 2; const int col_channel = 3; const int col_wep = 4; const int col_traffic = 5; const int col_ip = 6; const int col_manuf = 7; const int col_firstseen = 8; const int col_lastseen = 9; const int col_location = 10; #define DEBUG MScanListView::MScanListView( QWidget* parent, const char* name ) :OListView( parent, name ) { setFrameShape( QListView::StyledPanel ); setFrameShadow( QListView::Sunken ); addColumn( tr( "Net/Station" ) ); setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); addColumn( tr( "#" ) ); setColumnAlignment( col_sig, AlignCenter ); addColumn( tr( "MAC" ) ); setColumnAlignment( col_ap, AlignCenter ); addColumn( tr( "Chn" ) ); setColumnAlignment( col_channel, AlignCenter ); addColumn( tr( "W" ) ); setColumnAlignment( col_wep, AlignCenter ); addColumn( tr( "T" ) ); setColumnAlignment( col_traffic, AlignCenter ); addColumn( tr( "IP" ) ); setColumnAlignment( col_ip, AlignCenter ); addColumn( tr( "Manufacturer" ) ); setColumnAlignment( col_manuf, AlignCenter ); addColumn( tr( "First Seen" ) ); setColumnAlignment( col_firstseen, AlignCenter ); addColumn( tr( "Last Seen" ) ); setColumnAlignment( col_lastseen, AlignCenter ); addColumn( tr( "Location" ) ); setColumnAlignment( col_location, AlignCenter ); setRootIsDecorated( true ); setAllColumnsShowFocus( true ); - connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), + connect( this, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); #ifdef QWS QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); #endif }; MScanListView::~MScanListView() { }; OListViewItem* MScanListView::childFactory() { return new MScanListItem( this ); } void MScanListView::serializeTo( QDataStream& s) const { odebug << "serializing MScanListView" << oendl; OListView::serializeTo( s ); } void MScanListView::serializeFrom( QDataStream& s) { odebug << "serializing MScanListView" << oendl; OListView::serializeFrom( s ); } void MScanListView::addNewItem( const QString& type, const QString& essid, const OMacAddress& mac, bool wep, int channel, int signal, const GpsLocation& loc, bool probe ) { QString macaddr = mac.toString(true); #ifdef DEBUG odebug << "MScanList::addNewItem( " << type << " / " << essid << " / " << macaddr << " [" << channel << "]" << oendl; #endif // search, if we already have seen this net QString s; MScanListItem* network; MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); while ( item && ( item->text( col_essid ) != essid ) ) { #ifdef DEBUG odebug << "itemtext: " << item->text( col_essid ) << "" << oendl; #endif item = static_cast<MScanListItem*> ( item->nextSibling() ); } if ( item ) { // we have already seen this net, check all childs if MAC exists network = item; item = static_cast<MScanListItem*> ( item->firstChild() ); assert( item ); // this shouldn't fail while ( item && ( item->text( col_ap ) != macaddr ) ) { #ifdef DEBUG odebug << "subitemtext: " << item->text( col_ap ) << "" << oendl; #endif item = static_cast<MScanListItem*> ( item->nextSibling() ); } if ( item ) { // we have already seen this item, it's a dupe #ifdef DEBUG odebug << "" << macaddr << " is a dupe - ignoring..." << oendl; #endif item->receivedBeacon(); return; } } else { s = QString( "(i) New network: ESSID '%1'" ).arg( essid ); MLogWindow::logwindow()->log( s ); network = new MScanListItem( this, "network", essid, QString::null, 0, 0, 0, probe ); |